@@ -1420,9 +1420,9 @@ func TestArrayEachWithWhiteSpace(t *testing.T) {
1420
1420
keys []string
1421
1421
}
1422
1422
tests := []struct {
1423
- name string
1424
- args args
1425
- wantErr bool
1423
+ name string
1424
+ args args
1425
+ wantErr bool
1426
1426
}{
1427
1427
{"Array with white space" , args {[]byte (` ["AAA", "BBB", "CCC"]` ), funcSuccess , []string {}}, false },
1428
1428
{"Array with only one character after white space" , args {[]byte (` 1` ), funcError , []string {}}, true },
@@ -1675,8 +1675,9 @@ func TestEachKey(t *testing.T) {
1675
1675
{"arrInt" , "[3]" },
1676
1676
{"arrInt" , "[5]" }, // Should not find last key
1677
1677
{"nested" },
1678
- {"arr" , "[" }, // issue#177 Invalid arguments
1679
- {"a\n " , "b\n " }, // issue#165
1678
+ {"arr" , "[" }, // issue#177 Invalid arguments
1679
+ {"a\n " , "b\n " }, // issue#165
1680
+ {"nested" , "b" }, // Should find repeated key
1680
1681
}
1681
1682
1682
1683
keysFound := 0
@@ -1729,13 +1730,17 @@ func TestEachKey(t *testing.T) {
1729
1730
if string (value ) != "99" {
1730
1731
t .Error ("Should find 10 key" , string (value ))
1731
1732
}
1733
+ case 12 :
1734
+ if string (value ) != "2" {
1735
+ t .Errorf ("Should find 11 key" )
1736
+ }
1732
1737
default :
1733
1738
t .Errorf ("Should find only 10 keys, got %v key" , idx )
1734
1739
}
1735
1740
}, paths ... )
1736
1741
1737
- if keysFound != 10 {
1738
- t .Errorf ("Should find 10 keys: %d" , keysFound )
1742
+ if keysFound != 11 {
1743
+ t .Errorf ("Should find 11 keys: %d" , keysFound )
1739
1744
}
1740
1745
}
1741
1746
0 commit comments