From 415568fc9c1f21320bf9287b30e6964a3ab2ec17 Mon Sep 17 00:00:00 2001 From: groobyming Date: Mon, 20 May 2024 11:06:00 +0800 Subject: [PATCH] add some case insensitive test cases --- src/parser/parse.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/parser/parse.rs b/src/parser/parse.rs index 7b03281..ed0d070 100644 --- a/src/parser/parse.rs +++ b/src/parser/parse.rs @@ -2210,6 +2210,20 @@ mod tests { .iter() .for_each(|expr| assert_eq!(parser::parse(expr).unwrap().to_string(), *expr)); + let or_insensitive_cases = vec![ + r#"a{label1="1" or label2="2"}"#, + r#"a{label1="1" OR label2="2"}"#, + r#"a{label1="1" Or label2="2"}"#, + r#"a{label1="1" oR label2="2"}"#, + ]; + + or_insensitive_cases.iter().for_each(|expr| { + assert_eq!( + parser::parse(expr).unwrap().to_string(), + r#"a{label1="1" or label2="2"}"# + ) + }); + let fail_cases = vec![ ( r#"foo{or}"#,