From 0cb53207ec561d40bc850365ffd6310412ee82aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Massot?= Date: Sun, 11 Jun 2023 12:13:35 +0200 Subject: [PATCH] Fix tests. --- src/query/query_parser/query_parser.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/query/query_parser/query_parser.rs b/src/query/query_parser/query_parser.rs index 72a735848..4a8b86469 100644 --- a/src/query/query_parser/query_parser.rs +++ b/src/query/query_parser/query_parser.rs @@ -1203,7 +1203,7 @@ mod test { fn test_json_field_possibly_a_number() { test_parse_query_to_logical_ast_helper( "json.titi:5", - r#"(Term(field=14, type=Json, path=titi, type=U64, 5) Term(field=14, type=Json, path=titi, type=Str, "5"))"#, + r#"(Term(field=14, type=Json, path=titi, type=I64, 5) Term(field=14, type=Json, path=titi, type=Str, "5"))"#, true, ); test_parse_query_to_logical_ast_helper( @@ -1211,6 +1211,11 @@ mod test { r#"(Term(field=14, type=Json, path=titi, type=I64, -5) Term(field=14, type=Json, path=titi, type=Str, "5"))"#, //< Yes this is a bit weird after going through the tokenizer we lose the "-". true, ); + test_parse_query_to_logical_ast_helper( + "json.titi:10000000000000000000", + r#"(Term(field=14, type=Json, path=titi, type=U64, 10000000000000000000) Term(field=14, type=Json, path=titi, type=Str, "10000000000000000000"))"#, + true, + ); test_parse_query_to_logical_ast_helper( "json.titi:-5.2", r#"(Term(field=14, type=Json, path=titi, type=F64, -5.2) "[(0, Term(field=14, type=Json, path=titi, type=Str, "5")), (1, Term(field=14, type=Json, path=titi, type=Str, "2"))]")"#, @@ -1260,7 +1265,7 @@ mod test { fn test_json_default() { test_query_to_logical_ast_with_default_json( "titi:4", - "(Term(field=14, type=Json, path=titi, type=U64, 4) Term(field=14, type=Json, \ + "(Term(field=14, type=Json, path=titi, type=I64, 4) Term(field=14, type=Json, \ path=titi, type=Str, \"4\"))", false, ); @@ -1282,7 +1287,7 @@ mod test { for conjunction in [false, true] { test_query_to_logical_ast_with_default_json( "json:4", - r#"(Term(field=14, type=Json, path=, type=U64, 4) Term(field=14, type=Json, path=, type=Str, "4"))"#, + r#"(Term(field=14, type=Json, path=, type=I64, 4) Term(field=14, type=Json, path=, type=Str, "4"))"#, conjunction, ); }