From cd46ebd6b5461be584d35438ec8a983993e4ecee Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 8 Jul 2024 18:38:05 +0200 Subject: [PATCH] remove insta deprecating --- dump/src/reader/compat/v2_to_v3.rs | 2 +- dump/src/reader/compat/v3_to_v4.rs | 2 +- dump/src/reader/compat/v4_to_v5.rs | 4 +- dump/src/reader/compat/v5_to_v6.rs | 4 +- dump/src/reader/mod.rs | 18 +- dump/src/reader/v2/mod.rs | 4 +- dump/src/reader/v3/mod.rs | 2 +- dump/src/reader/v4/mod.rs | 4 +- dump/src/reader/v5/mod.rs | 4 +- dump/src/writer.rs | 2 +- filter-parser/src/lib.rs | 228 ++++++++++++------------ milli/src/index.rs | 8 +- milli/src/update/index_documents/mod.rs | 40 ++--- 13 files changed, 161 insertions(+), 161 deletions(-) diff --git a/dump/src/reader/compat/v2_to_v3.rs b/dump/src/reader/compat/v2_to_v3.rs index 82a3b9e84..e7516e708 100644 --- a/dump/src/reader/compat/v2_to_v3.rs +++ b/dump/src/reader/compat/v2_to_v3.rs @@ -425,7 +425,7 @@ pub(crate) mod test { let mut dump = v2::V2Reader::open(dir).unwrap().to_v3(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-09 20:27:59.904096267 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-09 20:27:59.904096267 +00:00:00"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/reader/compat/v3_to_v4.rs b/dump/src/reader/compat/v3_to_v4.rs index 244948200..5bb70e9b2 100644 --- a/dump/src/reader/compat/v3_to_v4.rs +++ b/dump/src/reader/compat/v3_to_v4.rs @@ -358,7 +358,7 @@ pub(crate) mod test { let mut dump = v3::V3Reader::open(dir).unwrap().to_v4(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-07 11:39:03.709153554 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-07 11:39:03.709153554 +00:00:00"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/reader/compat/v4_to_v5.rs b/dump/src/reader/compat/v4_to_v5.rs index aa8441779..e52acb176 100644 --- a/dump/src/reader/compat/v4_to_v5.rs +++ b/dump/src/reader/compat/v4_to_v5.rs @@ -394,8 +394,8 @@ pub(crate) mod test { let mut dump = v4::V4Reader::open(dir).unwrap().to_v5(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-06 12:53:49.131989609 +00:00:00"); - insta::assert_display_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-06 12:53:49.131989609 +00:00:00"); + insta::assert_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/reader/compat/v5_to_v6.rs b/dump/src/reader/compat/v5_to_v6.rs index c022507ca..e6e030186 100644 --- a/dump/src/reader/compat/v5_to_v6.rs +++ b/dump/src/reader/compat/v5_to_v6.rs @@ -442,8 +442,8 @@ pub(crate) mod test { let mut dump = v5::V5Reader::open(dir).unwrap().to_v6(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-04 15:55:10.344982459 +00:00:00"); - insta::assert_display_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-04 15:55:10.344982459 +00:00:00"); + insta::assert_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); diff --git a/dump/src/reader/mod.rs b/dump/src/reader/mod.rs index 2b3732164..3b96cbfb0 100644 --- a/dump/src/reader/mod.rs +++ b/dump/src/reader/mod.rs @@ -216,7 +216,7 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2024-05-16 15:51:34.151044 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2024-05-16 15:51:34.151044 +00:00:00"); insta::assert_debug_snapshot!(dump.instance_uid().unwrap(), @"None"); // tasks @@ -337,7 +337,7 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2023-07-06 7:10:27.21958 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2023-07-06 7:10:27.21958 +00:00:00"); insta::assert_debug_snapshot!(dump.instance_uid().unwrap(), @"None"); // tasks @@ -383,8 +383,8 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-04 15:55:10.344982459 +00:00:00"); - insta::assert_display_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-04 15:55:10.344982459 +00:00:00"); + insta::assert_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); @@ -463,8 +463,8 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-06 12:53:49.131989609 +00:00:00"); - insta::assert_display_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-06 12:53:49.131989609 +00:00:00"); + insta::assert_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); @@ -540,7 +540,7 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-07 11:39:03.709153554 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-07 11:39:03.709153554 +00:00:00"); assert_eq!(dump.instance_uid().unwrap(), None); // tasks @@ -633,7 +633,7 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-09 20:27:59.904096267 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-09 20:27:59.904096267 +00:00:00"); assert_eq!(dump.instance_uid().unwrap(), None); // tasks @@ -726,7 +726,7 @@ pub(crate) mod test { let mut dump = DumpReader::open(dump).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2023-01-30 16:26:09.247261 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2023-01-30 16:26:09.247261 +00:00:00"); assert_eq!(dump.instance_uid().unwrap(), None); // tasks diff --git a/dump/src/reader/v2/mod.rs b/dump/src/reader/v2/mod.rs index a0ff13a3b..14a643c2d 100644 --- a/dump/src/reader/v2/mod.rs +++ b/dump/src/reader/v2/mod.rs @@ -252,7 +252,7 @@ pub(crate) mod test { let mut dump = V2Reader::open(dir).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-09 20:27:59.904096267 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-09 20:27:59.904096267 +00:00:00"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); @@ -349,7 +349,7 @@ pub(crate) mod test { let mut dump = V2Reader::open(dir).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2023-01-30 16:26:09.247261 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2023-01-30 16:26:09.247261 +00:00:00"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/reader/v3/mod.rs b/dump/src/reader/v3/mod.rs index 560a901cd..920e1dc6e 100644 --- a/dump/src/reader/v3/mod.rs +++ b/dump/src/reader/v3/mod.rs @@ -267,7 +267,7 @@ pub(crate) mod test { let mut dump = V3Reader::open(dir).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-07 11:39:03.709153554 +00:00:00"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-07 11:39:03.709153554 +00:00:00"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/reader/v4/mod.rs b/dump/src/reader/v4/mod.rs index e1e2fd0c1..585786ae4 100644 --- a/dump/src/reader/v4/mod.rs +++ b/dump/src/reader/v4/mod.rs @@ -262,8 +262,8 @@ pub(crate) mod test { let mut dump = V4Reader::open(dir).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-06 12:53:49.131989609 +00:00:00"); - insta::assert_display_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-06 12:53:49.131989609 +00:00:00"); + insta::assert_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/reader/v5/mod.rs b/dump/src/reader/v5/mod.rs index 3a22ca0a9..dfbc6346c 100644 --- a/dump/src/reader/v5/mod.rs +++ b/dump/src/reader/v5/mod.rs @@ -299,8 +299,8 @@ pub(crate) mod test { let mut dump = V5Reader::open(dir).unwrap(); // top level infos - insta::assert_display_snapshot!(dump.date().unwrap(), @"2022-10-04 15:55:10.344982459 +00:00:00"); - insta::assert_display_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); + insta::assert_snapshot!(dump.date().unwrap(), @"2022-10-04 15:55:10.344982459 +00:00:00"); + insta::assert_snapshot!(dump.instance_uid().unwrap().unwrap(), @"9e15e977-f2ae-4761-943f-1eaf75fd736d"); // tasks let tasks = dump.tasks().collect::>>().unwrap(); diff --git a/dump/src/writer.rs b/dump/src/writer.rs index ae89e7005..3ee51cabf 100644 --- a/dump/src/writer.rs +++ b/dump/src/writer.rs @@ -281,7 +281,7 @@ pub(crate) mod test { let dump_path = dump.path(); // ==== checking global file hierarchy (we want to be sure there isn't too many files or too few) - insta::assert_display_snapshot!(create_directory_hierarchy(dump_path), @r###" + insta::assert_snapshot!(create_directory_hierarchy(dump_path), @r###" . ├---- indexes/ │ └---- doggos/ diff --git a/filter-parser/src/lib.rs b/filter-parser/src/lib.rs index 6bfbbb024..077263e85 100644 --- a/filter-parser/src/lib.rs +++ b/filter-parser/src/lib.rs @@ -564,121 +564,121 @@ pub mod tests { #[test] fn parse_escaped() { - insta::assert_display_snapshot!(p(r"title = 'foo\\'"), @r#"{title} = {foo\}"#); - insta::assert_display_snapshot!(p(r"title = 'foo\\\\'"), @r#"{title} = {foo\\}"#); - insta::assert_display_snapshot!(p(r"title = 'foo\\\\\\'"), @r#"{title} = {foo\\\}"#); - insta::assert_display_snapshot!(p(r"title = 'foo\\\\\\\\'"), @r#"{title} = {foo\\\\}"#); + insta::assert_snapshot!(p(r"title = 'foo\\'"), @r#"{title} = {foo\}"#); + insta::assert_snapshot!(p(r"title = 'foo\\\\'"), @r#"{title} = {foo\\}"#); + insta::assert_snapshot!(p(r"title = 'foo\\\\\\'"), @r#"{title} = {foo\\\}"#); + insta::assert_snapshot!(p(r"title = 'foo\\\\\\\\'"), @r#"{title} = {foo\\\\}"#); // but it also works with other sequences - insta::assert_display_snapshot!(p(r#"title = 'foo\x20\n\t\"\'"'"#), @"{title} = {foo \n\t\"\'\"}"); + insta::assert_snapshot!(p(r#"title = 'foo\x20\n\t\"\'"'"#), @"{title} = {foo \n\t\"\'\"}"); } #[test] fn parse() { // Test equal - insta::assert_display_snapshot!(p("channel = Ponce"), @"{channel} = {Ponce}"); - insta::assert_display_snapshot!(p("subscribers = 12"), @"{subscribers} = {12}"); - insta::assert_display_snapshot!(p("channel = 'Mister Mv'"), @"{channel} = {Mister Mv}"); - insta::assert_display_snapshot!(p("channel = \"Mister Mv\""), @"{channel} = {Mister Mv}"); - insta::assert_display_snapshot!(p("'dog race' = Borzoi"), @"{dog race} = {Borzoi}"); - insta::assert_display_snapshot!(p("\"dog race\" = Chusky"), @"{dog race} = {Chusky}"); - insta::assert_display_snapshot!(p("\"dog race\" = \"Bernese Mountain\""), @"{dog race} = {Bernese Mountain}"); - insta::assert_display_snapshot!(p("'dog race' = 'Bernese Mountain'"), @"{dog race} = {Bernese Mountain}"); - insta::assert_display_snapshot!(p("\"dog race\" = 'Bernese Mountain'"), @"{dog race} = {Bernese Mountain}"); + insta::assert_snapshot!(p("channel = Ponce"), @"{channel} = {Ponce}"); + insta::assert_snapshot!(p("subscribers = 12"), @"{subscribers} = {12}"); + insta::assert_snapshot!(p("channel = 'Mister Mv'"), @"{channel} = {Mister Mv}"); + insta::assert_snapshot!(p("channel = \"Mister Mv\""), @"{channel} = {Mister Mv}"); + insta::assert_snapshot!(p("'dog race' = Borzoi"), @"{dog race} = {Borzoi}"); + insta::assert_snapshot!(p("\"dog race\" = Chusky"), @"{dog race} = {Chusky}"); + insta::assert_snapshot!(p("\"dog race\" = \"Bernese Mountain\""), @"{dog race} = {Bernese Mountain}"); + insta::assert_snapshot!(p("'dog race' = 'Bernese Mountain'"), @"{dog race} = {Bernese Mountain}"); + insta::assert_snapshot!(p("\"dog race\" = 'Bernese Mountain'"), @"{dog race} = {Bernese Mountain}"); // Test IN - insta::assert_display_snapshot!(p("colour IN[]"), @"{colour} IN[]"); - insta::assert_display_snapshot!(p("colour IN[green]"), @"{colour} IN[{green}, ]"); - insta::assert_display_snapshot!(p("colour IN[green,]"), @"{colour} IN[{green}, ]"); - insta::assert_display_snapshot!(p("colour NOT IN[green,blue]"), @"NOT ({colour} IN[{green}, {blue}, ])"); - insta::assert_display_snapshot!(p(" colour IN [ green , blue , ]"), @"{colour} IN[{green}, {blue}, ]"); + insta::assert_snapshot!(p("colour IN[]"), @"{colour} IN[]"); + insta::assert_snapshot!(p("colour IN[green]"), @"{colour} IN[{green}, ]"); + insta::assert_snapshot!(p("colour IN[green,]"), @"{colour} IN[{green}, ]"); + insta::assert_snapshot!(p("colour NOT IN[green,blue]"), @"NOT ({colour} IN[{green}, {blue}, ])"); + insta::assert_snapshot!(p(" colour IN [ green , blue , ]"), @"{colour} IN[{green}, {blue}, ]"); // Test IN + OR/AND/() - insta::assert_display_snapshot!(p(" colour IN [green, blue] AND color = green "), @"AND[{colour} IN[{green}, {blue}, ], {color} = {green}, ]"); - insta::assert_display_snapshot!(p("NOT (colour IN [green, blue]) AND color = green "), @"AND[NOT ({colour} IN[{green}, {blue}, ]), {color} = {green}, ]"); - insta::assert_display_snapshot!(p("x = 1 OR NOT (colour IN [green, blue] OR color = green) "), @"OR[{x} = {1}, NOT (OR[{colour} IN[{green}, {blue}, ], {color} = {green}, ]), ]"); + insta::assert_snapshot!(p(" colour IN [green, blue] AND color = green "), @"AND[{colour} IN[{green}, {blue}, ], {color} = {green}, ]"); + insta::assert_snapshot!(p("NOT (colour IN [green, blue]) AND color = green "), @"AND[NOT ({colour} IN[{green}, {blue}, ]), {color} = {green}, ]"); + insta::assert_snapshot!(p("x = 1 OR NOT (colour IN [green, blue] OR color = green) "), @"OR[{x} = {1}, NOT (OR[{colour} IN[{green}, {blue}, ], {color} = {green}, ]), ]"); // Test whitespace start/end - insta::assert_display_snapshot!(p(" colour = green "), @"{colour} = {green}"); - insta::assert_display_snapshot!(p(" (colour = green OR colour = red) "), @"OR[{colour} = {green}, {colour} = {red}, ]"); - insta::assert_display_snapshot!(p(" colour IN [green, blue] AND color = green "), @"AND[{colour} IN[{green}, {blue}, ], {color} = {green}, ]"); - insta::assert_display_snapshot!(p(" colour NOT IN [green, blue] "), @"NOT ({colour} IN[{green}, {blue}, ])"); - insta::assert_display_snapshot!(p(" colour IN [green, blue] "), @"{colour} IN[{green}, {blue}, ]"); + insta::assert_snapshot!(p(" colour = green "), @"{colour} = {green}"); + insta::assert_snapshot!(p(" (colour = green OR colour = red) "), @"OR[{colour} = {green}, {colour} = {red}, ]"); + insta::assert_snapshot!(p(" colour IN [green, blue] AND color = green "), @"AND[{colour} IN[{green}, {blue}, ], {color} = {green}, ]"); + insta::assert_snapshot!(p(" colour NOT IN [green, blue] "), @"NOT ({colour} IN[{green}, {blue}, ])"); + insta::assert_snapshot!(p(" colour IN [green, blue] "), @"{colour} IN[{green}, {blue}, ]"); // Test conditions - insta::assert_display_snapshot!(p("channel != ponce"), @"{channel} != {ponce}"); - insta::assert_display_snapshot!(p("NOT channel = ponce"), @"NOT ({channel} = {ponce})"); - insta::assert_display_snapshot!(p("subscribers < 1000"), @"{subscribers} < {1000}"); - insta::assert_display_snapshot!(p("subscribers > 1000"), @"{subscribers} > {1000}"); - insta::assert_display_snapshot!(p("subscribers <= 1000"), @"{subscribers} <= {1000}"); - insta::assert_display_snapshot!(p("subscribers >= 1000"), @"{subscribers} >= {1000}"); - insta::assert_display_snapshot!(p("subscribers <= 1000"), @"{subscribers} <= {1000}"); - insta::assert_display_snapshot!(p("subscribers 100 TO 1000"), @"{subscribers} {100} TO {1000}"); + insta::assert_snapshot!(p("channel != ponce"), @"{channel} != {ponce}"); + insta::assert_snapshot!(p("NOT channel = ponce"), @"NOT ({channel} = {ponce})"); + insta::assert_snapshot!(p("subscribers < 1000"), @"{subscribers} < {1000}"); + insta::assert_snapshot!(p("subscribers > 1000"), @"{subscribers} > {1000}"); + insta::assert_snapshot!(p("subscribers <= 1000"), @"{subscribers} <= {1000}"); + insta::assert_snapshot!(p("subscribers >= 1000"), @"{subscribers} >= {1000}"); + insta::assert_snapshot!(p("subscribers <= 1000"), @"{subscribers} <= {1000}"); + insta::assert_snapshot!(p("subscribers 100 TO 1000"), @"{subscribers} {100} TO {1000}"); // Test NOT - insta::assert_display_snapshot!(p("NOT subscribers < 1000"), @"NOT ({subscribers} < {1000})"); - insta::assert_display_snapshot!(p("NOT subscribers 100 TO 1000"), @"NOT ({subscribers} {100} TO {1000})"); + insta::assert_snapshot!(p("NOT subscribers < 1000"), @"NOT ({subscribers} < {1000})"); + insta::assert_snapshot!(p("NOT subscribers 100 TO 1000"), @"NOT ({subscribers} {100} TO {1000})"); // Test NULL + NOT NULL - insta::assert_display_snapshot!(p("subscribers IS NULL"), @"{subscribers} IS NULL"); - insta::assert_display_snapshot!(p("NOT subscribers IS NULL"), @"NOT ({subscribers} IS NULL)"); - insta::assert_display_snapshot!(p("subscribers IS NOT NULL"), @"NOT ({subscribers} IS NULL)"); - insta::assert_display_snapshot!(p("NOT subscribers IS NOT NULL"), @"{subscribers} IS NULL"); - insta::assert_display_snapshot!(p("subscribers IS NOT NULL"), @"NOT ({subscribers} IS NULL)"); + insta::assert_snapshot!(p("subscribers IS NULL"), @"{subscribers} IS NULL"); + insta::assert_snapshot!(p("NOT subscribers IS NULL"), @"NOT ({subscribers} IS NULL)"); + insta::assert_snapshot!(p("subscribers IS NOT NULL"), @"NOT ({subscribers} IS NULL)"); + insta::assert_snapshot!(p("NOT subscribers IS NOT NULL"), @"{subscribers} IS NULL"); + insta::assert_snapshot!(p("subscribers IS NOT NULL"), @"NOT ({subscribers} IS NULL)"); // Test EMPTY + NOT EMPTY - insta::assert_display_snapshot!(p("subscribers IS EMPTY"), @"{subscribers} IS EMPTY"); - insta::assert_display_snapshot!(p("NOT subscribers IS EMPTY"), @"NOT ({subscribers} IS EMPTY)"); - insta::assert_display_snapshot!(p("subscribers IS NOT EMPTY"), @"NOT ({subscribers} IS EMPTY)"); - insta::assert_display_snapshot!(p("NOT subscribers IS NOT EMPTY"), @"{subscribers} IS EMPTY"); - insta::assert_display_snapshot!(p("subscribers IS NOT EMPTY"), @"NOT ({subscribers} IS EMPTY)"); + insta::assert_snapshot!(p("subscribers IS EMPTY"), @"{subscribers} IS EMPTY"); + insta::assert_snapshot!(p("NOT subscribers IS EMPTY"), @"NOT ({subscribers} IS EMPTY)"); + insta::assert_snapshot!(p("subscribers IS NOT EMPTY"), @"NOT ({subscribers} IS EMPTY)"); + insta::assert_snapshot!(p("NOT subscribers IS NOT EMPTY"), @"{subscribers} IS EMPTY"); + insta::assert_snapshot!(p("subscribers IS NOT EMPTY"), @"NOT ({subscribers} IS EMPTY)"); // Test EXISTS + NOT EXITS - insta::assert_display_snapshot!(p("subscribers EXISTS"), @"{subscribers} EXISTS"); - insta::assert_display_snapshot!(p("NOT subscribers EXISTS"), @"NOT ({subscribers} EXISTS)"); - insta::assert_display_snapshot!(p("subscribers NOT EXISTS"), @"NOT ({subscribers} EXISTS)"); - insta::assert_display_snapshot!(p("NOT subscribers NOT EXISTS"), @"{subscribers} EXISTS"); - insta::assert_display_snapshot!(p("subscribers NOT EXISTS"), @"NOT ({subscribers} EXISTS)"); + insta::assert_snapshot!(p("subscribers EXISTS"), @"{subscribers} EXISTS"); + insta::assert_snapshot!(p("NOT subscribers EXISTS"), @"NOT ({subscribers} EXISTS)"); + insta::assert_snapshot!(p("subscribers NOT EXISTS"), @"NOT ({subscribers} EXISTS)"); + insta::assert_snapshot!(p("NOT subscribers NOT EXISTS"), @"{subscribers} EXISTS"); + insta::assert_snapshot!(p("subscribers NOT EXISTS"), @"NOT ({subscribers} EXISTS)"); // Test nested NOT - insta::assert_display_snapshot!(p("NOT NOT NOT NOT x = 5"), @"{x} = {5}"); - insta::assert_display_snapshot!(p("NOT NOT (NOT NOT x = 5)"), @"{x} = {5}"); + insta::assert_snapshot!(p("NOT NOT NOT NOT x = 5"), @"{x} = {5}"); + insta::assert_snapshot!(p("NOT NOT (NOT NOT x = 5)"), @"{x} = {5}"); // Test geo radius - insta::assert_display_snapshot!(p("_geoRadius(12, 13, 14)"), @"_geoRadius({12}, {13}, {14})"); - insta::assert_display_snapshot!(p("NOT _geoRadius(12, 13, 14)"), @"NOT (_geoRadius({12}, {13}, {14}))"); - insta::assert_display_snapshot!(p("_geoRadius(12,13,14)"), @"_geoRadius({12}, {13}, {14})"); + insta::assert_snapshot!(p("_geoRadius(12, 13, 14)"), @"_geoRadius({12}, {13}, {14})"); + insta::assert_snapshot!(p("NOT _geoRadius(12, 13, 14)"), @"NOT (_geoRadius({12}, {13}, {14}))"); + insta::assert_snapshot!(p("_geoRadius(12,13,14)"), @"_geoRadius({12}, {13}, {14})"); // Test geo bounding box - insta::assert_display_snapshot!(p("_geoBoundingBox([12, 13], [14, 15])"), @"_geoBoundingBox([{12}, {13}], [{14}, {15}])"); - insta::assert_display_snapshot!(p("NOT _geoBoundingBox([12, 13], [14, 15])"), @"NOT (_geoBoundingBox([{12}, {13}], [{14}, {15}]))"); - insta::assert_display_snapshot!(p("_geoBoundingBox([12,13],[14,15])"), @"_geoBoundingBox([{12}, {13}], [{14}, {15}])"); + insta::assert_snapshot!(p("_geoBoundingBox([12, 13], [14, 15])"), @"_geoBoundingBox([{12}, {13}], [{14}, {15}])"); + insta::assert_snapshot!(p("NOT _geoBoundingBox([12, 13], [14, 15])"), @"NOT (_geoBoundingBox([{12}, {13}], [{14}, {15}]))"); + insta::assert_snapshot!(p("_geoBoundingBox([12,13],[14,15])"), @"_geoBoundingBox([{12}, {13}], [{14}, {15}])"); // Test OR + AND - insta::assert_display_snapshot!(p("channel = ponce AND 'dog race' != 'bernese mountain'"), @"AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ]"); - insta::assert_display_snapshot!(p("channel = ponce OR 'dog race' != 'bernese mountain'"), @"OR[{channel} = {ponce}, {dog race} != {bernese mountain}, ]"); - insta::assert_display_snapshot!(p("channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000"), @"OR[AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ], {subscribers} > {1000}, ]"); - insta::assert_display_snapshot!( + insta::assert_snapshot!(p("channel = ponce AND 'dog race' != 'bernese mountain'"), @"AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ]"); + insta::assert_snapshot!(p("channel = ponce OR 'dog race' != 'bernese mountain'"), @"OR[{channel} = {ponce}, {dog race} != {bernese mountain}, ]"); + insta::assert_snapshot!(p("channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000"), @"OR[AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ], {subscribers} > {1000}, ]"); + insta::assert_snapshot!( p("channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000 OR colour = red OR colour = blue AND size = 7"), @"OR[AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ], {subscribers} > {1000}, {colour} = {red}, AND[{colour} = {blue}, {size} = {7}, ], ]" ); // Test parentheses - insta::assert_display_snapshot!(p("channel = ponce AND ( 'dog race' != 'bernese mountain' OR subscribers > 1000 )"), @"AND[{channel} = {ponce}, OR[{dog race} != {bernese mountain}, {subscribers} > {1000}, ], ]"); - insta::assert_display_snapshot!(p("(channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000) AND _geoRadius(12, 13, 14)"), @"AND[OR[AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ], {subscribers} > {1000}, ], _geoRadius({12}, {13}, {14}), ]"); + insta::assert_snapshot!(p("channel = ponce AND ( 'dog race' != 'bernese mountain' OR subscribers > 1000 )"), @"AND[{channel} = {ponce}, OR[{dog race} != {bernese mountain}, {subscribers} > {1000}, ], ]"); + insta::assert_snapshot!(p("(channel = ponce AND 'dog race' != 'bernese mountain' OR subscribers > 1000) AND _geoRadius(12, 13, 14)"), @"AND[OR[AND[{channel} = {ponce}, {dog race} != {bernese mountain}, ], {subscribers} > {1000}, ], _geoRadius({12}, {13}, {14}), ]"); // Test recursion // This is the most that is allowed - insta::assert_display_snapshot!( + insta::assert_snapshot!( p("(((((((((((((((((((((((((((((((((((((((((((((((((x = 1)))))))))))))))))))))))))))))))))))))))))))))))))"), @"{x} = {1}" ); - insta::assert_display_snapshot!( + insta::assert_snapshot!( p("NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT x = 1"), @"NOT ({x} = {1})" ); // Confusing keywords - insta::assert_display_snapshot!(p(r#"NOT "OR" EXISTS AND "EXISTS" NOT EXISTS"#), @"AND[NOT ({OR} EXISTS), NOT ({EXISTS} EXISTS), ]"); + insta::assert_snapshot!(p(r#"NOT "OR" EXISTS AND "EXISTS" NOT EXISTS"#), @"AND[NOT ({OR} EXISTS), NOT ({EXISTS} EXISTS), ]"); } #[test] @@ -689,182 +689,182 @@ pub mod tests { Fc::parse(s).unwrap_err().to_string() } - insta::assert_display_snapshot!(p("channel = Ponce = 12"), @r###" + insta::assert_snapshot!(p("channel = Ponce = 12"), @r###" Found unexpected characters at the end of the filter: `= 12`. You probably forgot an `OR` or an `AND` rule. 17:21 channel = Ponce = 12 "###); - insta::assert_display_snapshot!(p("channel = "), @r###" + insta::assert_snapshot!(p("channel = "), @r###" Was expecting a value but instead got nothing. 14:14 channel = "###); - insta::assert_display_snapshot!(p("channel = 🐻"), @r###" + insta::assert_snapshot!(p("channel = 🐻"), @r###" Was expecting a value but instead got `🐻`. 11:12 channel = 🐻 "###); - insta::assert_display_snapshot!(p("channel = 🐻 AND followers < 100"), @r###" + insta::assert_snapshot!(p("channel = 🐻 AND followers < 100"), @r###" Was expecting a value but instead got `🐻`. 11:12 channel = 🐻 AND followers < 100 "###); - insta::assert_display_snapshot!(p("'OR'"), @r###" + insta::assert_snapshot!(p("'OR'"), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `\'OR\'`. 1:5 'OR' "###); - insta::assert_display_snapshot!(p("OR"), @r###" + insta::assert_snapshot!(p("OR"), @r###" Was expecting a value but instead got `OR`, which is a reserved keyword. To use `OR` as a field name or a value, surround it by quotes. 1:3 OR "###); - insta::assert_display_snapshot!(p("channel Ponce"), @r###" + insta::assert_snapshot!(p("channel Ponce"), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `channel Ponce`. 1:14 channel Ponce "###); - insta::assert_display_snapshot!(p("channel = Ponce OR"), @r###" + insta::assert_snapshot!(p("channel = Ponce OR"), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` but instead got nothing. 19:19 channel = Ponce OR "###); - insta::assert_display_snapshot!(p("_geoRadius"), @r###" + insta::assert_snapshot!(p("_geoRadius"), @r###" The `_geoRadius` filter expects three arguments: `_geoRadius(latitude, longitude, radius)`. 1:11 _geoRadius "###); - insta::assert_display_snapshot!(p("_geoRadius = 12"), @r###" + insta::assert_snapshot!(p("_geoRadius = 12"), @r###" The `_geoRadius` filter expects three arguments: `_geoRadius(latitude, longitude, radius)`. 1:16 _geoRadius = 12 "###); - insta::assert_display_snapshot!(p("_geoBoundingBox"), @r###" + insta::assert_snapshot!(p("_geoBoundingBox"), @r###" The `_geoBoundingBox` filter expects two pairs of arguments: `_geoBoundingBox([latitude, longitude], [latitude, longitude])`. 1:16 _geoBoundingBox "###); - insta::assert_display_snapshot!(p("_geoBoundingBox = 12"), @r###" + insta::assert_snapshot!(p("_geoBoundingBox = 12"), @r###" The `_geoBoundingBox` filter expects two pairs of arguments: `_geoBoundingBox([latitude, longitude], [latitude, longitude])`. 1:21 _geoBoundingBox = 12 "###); - insta::assert_display_snapshot!(p("_geoBoundingBox(1.0, 1.0)"), @r###" + insta::assert_snapshot!(p("_geoBoundingBox(1.0, 1.0)"), @r###" The `_geoBoundingBox` filter expects two pairs of arguments: `_geoBoundingBox([latitude, longitude], [latitude, longitude])`. 1:26 _geoBoundingBox(1.0, 1.0) "###); - insta::assert_display_snapshot!(p("_geoPoint(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("_geoPoint(12, 13, 14)"), @r###" `_geoPoint` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates. 1:22 _geoPoint(12, 13, 14) "###); - insta::assert_display_snapshot!(p("position <= _geoPoint(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("position <= _geoPoint(12, 13, 14)"), @r###" `_geoPoint` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates. 13:34 position <= _geoPoint(12, 13, 14) "###); - insta::assert_display_snapshot!(p("_geoDistance(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("_geoDistance(12, 13, 14)"), @r###" `_geoDistance` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates. 1:25 _geoDistance(12, 13, 14) "###); - insta::assert_display_snapshot!(p("position <= _geoDistance(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("position <= _geoDistance(12, 13, 14)"), @r###" `_geoDistance` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates. 13:37 position <= _geoDistance(12, 13, 14) "###); - insta::assert_display_snapshot!(p("_geo(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("_geo(12, 13, 14)"), @r###" `_geo` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates. 1:17 _geo(12, 13, 14) "###); - insta::assert_display_snapshot!(p("position <= _geo(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("position <= _geo(12, 13, 14)"), @r###" `_geo` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates. 13:29 position <= _geo(12, 13, 14) "###); - insta::assert_display_snapshot!(p("position <= _geoRadius(12, 13, 14)"), @r###" + insta::assert_snapshot!(p("position <= _geoRadius(12, 13, 14)"), @r###" The `_geoRadius` filter is an operation and can't be used as a value. 13:35 position <= _geoRadius(12, 13, 14) "###); - insta::assert_display_snapshot!(p("channel = 'ponce"), @r###" + insta::assert_snapshot!(p("channel = 'ponce"), @r###" Expression `\'ponce` is missing the following closing delimiter: `'`. 11:17 channel = 'ponce "###); - insta::assert_display_snapshot!(p("channel = \"ponce"), @r###" + insta::assert_snapshot!(p("channel = \"ponce"), @r###" Expression `\"ponce` is missing the following closing delimiter: `"`. 11:17 channel = "ponce "###); - insta::assert_display_snapshot!(p("channel = mv OR (followers >= 1000"), @r###" + insta::assert_snapshot!(p("channel = mv OR (followers >= 1000"), @r###" Expression `(followers >= 1000` is missing the following closing delimiter: `)`. 17:35 channel = mv OR (followers >= 1000 "###); - insta::assert_display_snapshot!(p("channel = mv OR followers >= 1000)"), @r###" + insta::assert_snapshot!(p("channel = mv OR followers >= 1000)"), @r###" Found unexpected characters at the end of the filter: `)`. You probably forgot an `OR` or an `AND` rule. 34:35 channel = mv OR followers >= 1000) "###); - insta::assert_display_snapshot!(p("colour NOT EXIST"), @r###" + insta::assert_snapshot!(p("colour NOT EXIST"), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `colour NOT EXIST`. 1:17 colour NOT EXIST "###); - insta::assert_display_snapshot!(p("subscribers 100 TO1000"), @r###" + insta::assert_snapshot!(p("subscribers 100 TO1000"), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `subscribers 100 TO1000`. 1:23 subscribers 100 TO1000 "###); - insta::assert_display_snapshot!(p("channel = ponce ORdog != 'bernese mountain'"), @r###" + insta::assert_snapshot!(p("channel = ponce ORdog != 'bernese mountain'"), @r###" Found unexpected characters at the end of the filter: `ORdog != \'bernese mountain\'`. You probably forgot an `OR` or an `AND` rule. 17:44 channel = ponce ORdog != 'bernese mountain' "###); - insta::assert_display_snapshot!(p("colour IN blue, green]"), @r###" + insta::assert_snapshot!(p("colour IN blue, green]"), @r###" Expected `[` after `IN` keyword. 11:23 colour IN blue, green] "###); - insta::assert_display_snapshot!(p("colour IN [blue, green, 'blue' > 2]"), @r###" + insta::assert_snapshot!(p("colour IN [blue, green, 'blue' > 2]"), @r###" Expected only comma-separated field names inside `IN[..]` but instead found `> 2]`. 32:36 colour IN [blue, green, 'blue' > 2] "###); - insta::assert_display_snapshot!(p("colour IN [blue, green, AND]"), @r###" + insta::assert_snapshot!(p("colour IN [blue, green, AND]"), @r###" Expected only comma-separated field names inside `IN[..]` but instead found `AND]`. 25:29 colour IN [blue, green, AND] "###); - insta::assert_display_snapshot!(p("colour IN [blue, green"), @r###" + insta::assert_snapshot!(p("colour IN [blue, green"), @r###" Expected matching `]` after the list of field names given to `IN[` 23:23 colour IN [blue, green "###); - insta::assert_display_snapshot!(p("colour IN ['blue, green"), @r###" + insta::assert_snapshot!(p("colour IN ['blue, green"), @r###" Expression `\'blue, green` is missing the following closing delimiter: `'`. 12:24 colour IN ['blue, green "###); - insta::assert_display_snapshot!(p("x = EXISTS"), @r###" + insta::assert_snapshot!(p("x = EXISTS"), @r###" Was expecting a value but instead got `EXISTS`, which is a reserved keyword. To use `EXISTS` as a field name or a value, surround it by quotes. 5:11 x = EXISTS "###); - insta::assert_display_snapshot!(p("AND = 8"), @r###" + insta::assert_snapshot!(p("AND = 8"), @r###" Was expecting a value but instead got `AND`, which is a reserved keyword. To use `AND` as a field name or a value, surround it by quotes. 1:4 AND = 8 "###); - insta::assert_display_snapshot!(p("((((((((((((((((((((((((((((((((((((((((((((((((((x = 1))))))))))))))))))))))))))))))))))))))))))))))))))"), @r###" + insta::assert_snapshot!(p("((((((((((((((((((((((((((((((((((((((((((((((((((x = 1))))))))))))))))))))))))))))))))))))))))))))))))))"), @r###" The filter exceeded the maximum depth limit. Try rewriting the filter so that it contains fewer nested conditions. 51:106 ((((((((((((((((((((((((((((((((((((((((((((((((((x = 1)))))))))))))))))))))))))))))))))))))))))))))))))) "###); - insta::assert_display_snapshot!( + insta::assert_snapshot!( p("NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT NOT x = 1"), @r###" The filter exceeded the maximum depth limit. Try rewriting the filter so that it contains fewer nested conditions. @@ -872,40 +872,40 @@ pub mod tests { "### ); - insta::assert_display_snapshot!(p(r#"NOT OR EXISTS AND EXISTS NOT EXISTS"#), @r###" + insta::assert_snapshot!(p(r#"NOT OR EXISTS AND EXISTS NOT EXISTS"#), @r###" Was expecting a value but instead got `OR`, which is a reserved keyword. To use `OR` as a field name or a value, surround it by quotes. 5:7 NOT OR EXISTS AND EXISTS NOT EXISTS "###); - insta::assert_display_snapshot!(p(r#"value NULL"#), @r###" + insta::assert_snapshot!(p(r#"value NULL"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value NULL`. 1:11 value NULL "###); - insta::assert_display_snapshot!(p(r#"value NOT NULL"#), @r###" + insta::assert_snapshot!(p(r#"value NOT NULL"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value NOT NULL`. 1:15 value NOT NULL "###); - insta::assert_display_snapshot!(p(r#"value EMPTY"#), @r###" + insta::assert_snapshot!(p(r#"value EMPTY"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value EMPTY`. 1:12 value EMPTY "###); - insta::assert_display_snapshot!(p(r#"value NOT EMPTY"#), @r###" + insta::assert_snapshot!(p(r#"value NOT EMPTY"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value NOT EMPTY`. 1:16 value NOT EMPTY "###); - insta::assert_display_snapshot!(p(r#"value IS"#), @r###" + insta::assert_snapshot!(p(r#"value IS"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value IS`. 1:9 value IS "###); - insta::assert_display_snapshot!(p(r#"value IS NOT"#), @r###" + insta::assert_snapshot!(p(r#"value IS NOT"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value IS NOT`. 1:13 value IS NOT "###); - insta::assert_display_snapshot!(p(r#"value IS EXISTS"#), @r###" + insta::assert_snapshot!(p(r#"value IS EXISTS"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value IS EXISTS`. 1:16 value IS EXISTS "###); - insta::assert_display_snapshot!(p(r#"value IS NOT EXISTS"#), @r###" + insta::assert_snapshot!(p(r#"value IS NOT EXISTS"#), @r###" Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `_geoRadius`, or `_geoBoundingBox` at `value IS NOT EXISTS`. 1:20 value IS NOT EXISTS "###); diff --git a/milli/src/index.rs b/milli/src/index.rs index 0a7a20ce0..5148972e3 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -2089,7 +2089,7 @@ pub(crate) mod tests { .filter(Filter::from_str("_geoBoundingBox([-80, 0], [80, 0])").unwrap().unwrap()) .execute() .unwrap_err(); - insta::assert_display_snapshot!( + insta::assert_snapshot!( error, @r###" The top latitude `-80` is below the bottom latitude `80`. @@ -2102,7 +2102,7 @@ pub(crate) mod tests { .filter(Filter::from_str("_geoBoundingBox([-10, 0], [10, 0])").unwrap().unwrap()) .execute() .unwrap_err(); - insta::assert_display_snapshot!( + insta::assert_snapshot!( error, @r###" The top latitude `-10` is below the bottom latitude `10`. @@ -2684,7 +2684,7 @@ pub(crate) mod tests { documents!({ "id" : "doggo", "_geo": { "lat": 1, "lng": 2, "doggo": "are the best" }}), ) .unwrap_err(); - insta::assert_display_snapshot!(err, @r###"The `_geo` field in the document with the id: `"\"doggo\""` contains the following unexpected fields: `{"doggo":"are the best"}`."###); + insta::assert_snapshot!(err, @r###"The `_geo` field in the document with the id: `"\"doggo\""` contains the following unexpected fields: `{"doggo":"are the best"}`."###); db_snap!(index, geo_faceted_documents_ids); // ensure that no documents were inserted @@ -2694,7 +2694,7 @@ pub(crate) mod tests { documents!({ "id" : "doggo", "_geo": { "lat": 1, "lng": 2, "doggo": "are the best", "and": { "all": ["cats", { "are": "beautiful" } ] } } }), ) .unwrap_err(); - insta::assert_display_snapshot!(err, @r###"The `_geo` field in the document with the id: `"\"doggo\""` contains the following unexpected fields: `{"and":{"all":["cats",{"are":"beautiful"}]},"doggo":"are the best"}`."###); + insta::assert_snapshot!(err, @r###"The `_geo` field in the document with the id: `"\"doggo\""` contains the following unexpected fields: `{"and":{"all":["cats",{"are":"beautiful"}]},"doggo":"are the best"}`."###); db_snap!(index, geo_faceted_documents_ids); // ensure that no documents were inserted } diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 089b56025..093758dbe 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -2229,10 +2229,10 @@ mod tests { { "id": 3, "name": "jean", "age": 25 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"3"); + insta::assert_snapshot!(added.unwrap(), @"3"); let (builder, removed) = builder.remove_documents(vec![S("2")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"1"); + insta::assert_snapshot!(removed.unwrap(), @"1"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2271,17 +2271,17 @@ mod tests { { "id": 3, "name": "jean", "age": 25 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"3"); + insta::assert_snapshot!(added.unwrap(), @"3"); let documents = documents!([ { "id": 2, "catto": "jorts" }, { "id": 3, "legs": 4 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"2"); + insta::assert_snapshot!(added.unwrap(), @"2"); let (builder, removed) = builder.remove_documents(vec![S("1"), S("2")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"2"); + insta::assert_snapshot!(removed.unwrap(), @"2"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2319,7 +2319,7 @@ mod tests { { "id": 3, "name": "jean", "age": 25 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"3"); + insta::assert_snapshot!(added.unwrap(), @"3"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2354,10 +2354,10 @@ mod tests { { "id": 3, "legs": 4 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"2"); + insta::assert_snapshot!(added.unwrap(), @"2"); let (builder, removed) = builder.remove_documents(vec![S("1"), S("2")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"2"); + insta::assert_snapshot!(removed.unwrap(), @"2"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2390,14 +2390,14 @@ mod tests { .unwrap(); let (builder, removed) = builder.remove_documents(vec![S("1"), S("2")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"0"); + insta::assert_snapshot!(removed.unwrap(), @"0"); let documents = documents!([ { "id": 2, "doggo": { "name": "jean", "age": 20 } }, { "id": 3, "name": "bob", "age": 25 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"2"); + insta::assert_snapshot!(added.unwrap(), @"2"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2432,7 +2432,7 @@ mod tests { let (builder, removed) = builder.remove_documents(vec![S("1"), S("2"), S("1"), S("2")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"0"); + insta::assert_snapshot!(removed.unwrap(), @"0"); let documents = documents!([ { "id": 1, "doggo": "kevin" }, @@ -2440,11 +2440,11 @@ mod tests { { "id": 3, "name": "bob", "age": 25 }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"3"); + insta::assert_snapshot!(added.unwrap(), @"3"); let (builder, removed) = builder.remove_documents(vec![S("1"), S("2"), S("1"), S("2")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"2"); + insta::assert_snapshot!(removed.unwrap(), @"2"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2480,7 +2480,7 @@ mod tests { { "id": 1, "doggo": "kevin" }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"1"); + insta::assert_snapshot!(added.unwrap(), @"1"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2509,13 +2509,13 @@ mod tests { .unwrap(); let (builder, removed) = builder.remove_documents(vec![S("1")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"1"); + insta::assert_snapshot!(removed.unwrap(), @"1"); let documents = documents!([ { "id": 1, "catto": "jorts" }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"1"); + insta::assert_snapshot!(added.unwrap(), @"1"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2692,7 +2692,7 @@ mod tests { { "id": 1, "doggo": "bernese" }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"1"); + insta::assert_snapshot!(added.unwrap(), @"1"); // FINISHING let addition = builder.execute().unwrap(); @@ -2731,13 +2731,13 @@ mod tests { .unwrap(); let (builder, removed) = builder.remove_documents(vec![S("1")]).unwrap(); - insta::assert_display_snapshot!(removed.unwrap(), @"1"); + insta::assert_snapshot!(removed.unwrap(), @"1"); let documents = documents!([ { "id": 0, "catto": "jorts" }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"1"); + insta::assert_snapshot!(added.unwrap(), @"1"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###" @@ -2777,7 +2777,7 @@ mod tests { { "id": 1, "catto": "jorts" }, ]); let (builder, added) = builder.add_documents(documents).unwrap(); - insta::assert_display_snapshot!(added.unwrap(), @"1"); + insta::assert_snapshot!(added.unwrap(), @"1"); let addition = builder.execute().unwrap(); insta::assert_debug_snapshot!(addition, @r###"