Skip to content

Commit 123d7c8

Browse files
author
Etienne Laurin
committed
add test for non-null-terminated token
1 parent 6102f0b commit 123d7c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/unittest/pointertest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ TEST(Pointer, Get) {
674674
EXPECT_EQ(2u, unresolvedTokenIndex);
675675
EXPECT_TRUE(Pointer("/foo/0/a").Get(d, &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
676676
EXPECT_EQ(2u, unresolvedTokenIndex);
677+
678+
Pointer::Token tokens[] = { { "foo ...", 3, kPointerInvalidIndex } };
679+
EXPECT_EQ(&d["foo"], Pointer(tokens, 1).Get(d));
677680
}
678681

679682
TEST(Pointer, GetWithDefault) {

0 commit comments

Comments
 (0)