mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Fix tests that were supposed to escape characters
This commit is contained in:
parent
b42d48187a
commit
ea78060916
@ -318,17 +318,17 @@ pub mod test {
|
|||||||
("\"cha'nnel\"", "cha'nnel", false),
|
("\"cha'nnel\"", "cha'nnel", false),
|
||||||
("I'm tamo", "I", false),
|
("I'm tamo", "I", false),
|
||||||
// escaped thing but not quote
|
// escaped thing but not quote
|
||||||
(r#""\\""#, r#"\\"#, false),
|
(r#""\\""#, r#"\"#, true),
|
||||||
(r#""\\\\\\""#, r#"\\\\\\"#, false),
|
(r#""\\\\\\""#, r#"\\\"#, true),
|
||||||
(r#""aa\\aa""#, r#"aa\\aa"#, false),
|
(r#""aa\\aa""#, r#"aa\aa"#, true),
|
||||||
// with double quote
|
// with double quote
|
||||||
(r#""Hello \"world\"""#, r#"Hello "world""#, true),
|
(r#""Hello \"world\"""#, r#"Hello "world""#, true),
|
||||||
(r#""Hello \\\"world\\\"""#, r#"Hello \\"world\\""#, true),
|
(r#""Hello \\\"world\\\"""#, r#"Hello \"world\""#, true),
|
||||||
(r#""I'm \"super\" tamo""#, r#"I'm "super" tamo"#, true),
|
(r#""I'm \"super\" tamo""#, r#"I'm "super" tamo"#, true),
|
||||||
(r#""\"\"""#, r#""""#, true),
|
(r#""\"\"""#, r#""""#, true),
|
||||||
// with simple quote
|
// with simple quote
|
||||||
(r#"'Hello \'world\''"#, r#"Hello 'world'"#, true),
|
(r#"'Hello \'world\''"#, r#"Hello 'world'"#, true),
|
||||||
(r#"'Hello \\\'world\\\''"#, r#"Hello \\'world\\'"#, true),
|
(r#"'Hello \\\'world\\\''"#, r#"Hello \'world\'"#, true),
|
||||||
(r#"'I\'m "super" tamo'"#, r#"I'm "super" tamo"#, true),
|
(r#"'I\'m "super" tamo'"#, r#"I'm "super" tamo"#, true),
|
||||||
(r#"'\'\''"#, r#"''"#, true),
|
(r#"'\'\''"#, r#"''"#, true),
|
||||||
];
|
];
|
||||||
@ -350,7 +350,14 @@ pub mod test {
|
|||||||
"Filter `{}` was not supposed to be escaped",
|
"Filter `{}` was not supposed to be escaped",
|
||||||
input
|
input
|
||||||
);
|
);
|
||||||
assert_eq!(token.value(), expected, "Filter `{}` failed.", input);
|
assert_eq!(
|
||||||
|
token.value(),
|
||||||
|
expected,
|
||||||
|
"Filter `{}` failed by giving `{}` instead of `{}`.",
|
||||||
|
input,
|
||||||
|
token.value(),
|
||||||
|
expected
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user