File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/common/jsonb/tests/it Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ use common_jsonb::object_keys;
32
32
use common_jsonb:: parse_json_path;
33
33
use common_jsonb:: parse_value;
34
34
use common_jsonb:: to_string;
35
+ use common_jsonb:: Error ;
35
36
use common_jsonb:: JsonPath ;
36
37
use common_jsonb:: Number ;
37
38
use common_jsonb:: Object ;
@@ -374,6 +375,18 @@ fn test_parse_json_path() {
374
375
let path = parse_json_path ( s. as_bytes ( ) ) . unwrap ( ) ;
375
376
assert_eq ! ( & path[ ..] , & expect[ ..] ) ;
376
377
}
378
+
379
+ let wrong_sources = vec ! [
380
+ ( r#"\"\"\\k1\"\""# , Error :: InvalidToken ) ,
381
+ ( r#"\\k1\\'"# , Error :: InvalidToken ) ,
382
+ ] ;
383
+ for ( s, expect) in wrong_sources {
384
+ let path = parse_json_path ( s. as_bytes ( ) ) ;
385
+ match path {
386
+ Ok ( _) => println ! ( ) ,
387
+ Err ( _) => assert_eq ! ( Error :: InvalidToken , expect) ,
388
+ }
389
+ }
377
390
}
378
391
379
392
#[ test]
You can’t perform that action at this time.
0 commit comments