File tree 1 file changed +26
-0
lines changed
src/test/java/com/fasterxml/jackson/core/jsonptr
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .core .jsonptr ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+
5
+ import com .fasterxml .jackson .core .JUnit5TestBase ;
6
+ import com .fasterxml .jackson .core .JsonPointer ;
7
+
8
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
9
+
10
+ public class JsonPointer1425Test extends JUnit5TestBase
11
+ {
12
+
13
+ // [core#1425]
14
+ @ Test
15
+ public void test1425 () {
16
+ JsonPointer ptr = JsonPointer .compile ("/a/b/0/qwerty" );
17
+ JsonPointer head = ptr .head ();
18
+ assertEquals ("/a/b/0" , head .toString ());
19
+ head = head .head (); // Exception happens here
20
+ assertEquals ("/a/b" , head .toString ());
21
+ head = head .head ();
22
+ assertEquals ("/a" , head .toString ());
23
+ head = head .head ();
24
+ assertEquals ("" , head .toString ());
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments