Skip to content

Commit 6286d0f

Browse files
committed
test: JSONPath trailing slashes and whitespace
1 parent d7a3723 commit 6286d0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_json_pointer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,9 @@ def test_non_standard_index_pointer() -> None:
297297
assert JSONPointer("/foo/bar/#1").resolve(data) == 1
298298
with pytest.raises(JSONPointerIndexError):
299299
JSONPointer("/foo/bar/#9").resolve(data)
300+
301+
302+
def test_trailing_slash() -> None:
303+
data = {"foo": {"": [1, 2, 3], " ": [4, 5, 6]}}
304+
assert JSONPointer("/foo/").resolve(data) == [1, 2, 3]
305+
assert JSONPointer("/foo/ ").resolve(data) == [4, 5, 6]

0 commit comments

Comments
 (0)