File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ func tokenEnd(data []byte) int {
31
31
}
32
32
}
33
33
34
- return - 1
34
+ return len ( data )
35
35
}
36
36
37
37
// Find position of next character which is not whitespace
Original file line number Diff line number Diff line change @@ -39,6 +39,38 @@ type GetTest struct {
39
39
}
40
40
41
41
var getTests = []GetTest {
42
+ // Trivial tests
43
+ GetTest {
44
+ desc : "read string" ,
45
+ json : `""` ,
46
+ isFound : true ,
47
+ data : `` ,
48
+ },
49
+ GetTest {
50
+ desc : "read number" ,
51
+ json : `0` ,
52
+ isFound : true ,
53
+ data : `0` ,
54
+ },
55
+ GetTest {
56
+ desc : "read object" ,
57
+ json : `{}` ,
58
+ isFound : true ,
59
+ data : `{}` ,
60
+ },
61
+ GetTest {
62
+ desc : "read array" ,
63
+ json : `[]` ,
64
+ isFound : true ,
65
+ data : `[]` ,
66
+ },
67
+ GetTest {
68
+ desc : "read boolean" ,
69
+ json : `true` ,
70
+ isFound : true ,
71
+ data : `true` ,
72
+ },
73
+
42
74
// Found key tests
43
75
GetTest {
44
76
desc : "handling multiple nested keys with same name" ,
You can’t perform that action at this time.
0 commit comments