test: Add a test for LP quoting (#5210)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/24376/head
parent
727f0152d0
commit
de22b6b080
|
@ -333,6 +333,26 @@ mod tests {
|
|||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_string_escape() {
|
||||
assert_eq!(
|
||||
format!("\"{}\"", escape(r#"foo"#, DOUBLE_QUOTE)),
|
||||
r#""foo""#
|
||||
);
|
||||
assert_eq!(
|
||||
format!("\"{}\"", escape(r#"foo \ bar"#, DOUBLE_QUOTE)),
|
||||
r#""foo \\ bar""#
|
||||
);
|
||||
assert_eq!(
|
||||
format!("\"{}\"", escape(r#"foo " bar"#, DOUBLE_QUOTE)),
|
||||
r#""foo \" bar""#
|
||||
);
|
||||
assert_eq!(
|
||||
format!("\"{}\"", escape(r#"foo \" bar"#, DOUBLE_QUOTE)),
|
||||
r#""foo \\\" bar""#
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lp_builder() {
|
||||
const PLAIN: &str = "plain";
|
||||
|
|
Loading…
Reference in New Issue