Allow escaping quotes in strings.

This commit is contained in:
Stephen Chung
2020-04-11 12:46:10 +08:00
parent c1b16b1a35
commit d73cfb6da5
4 changed files with 22 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ fn test_string() -> Result<(), EvalAltResult> {
engine.eval::<String>(r#""Test string: \x58""#)?,
"Test string: X"
);
assert_eq!(engine.eval::<String>(r#""\"hello\"""#)?, r#""hello""#);
assert_eq!(engine.eval::<String>(r#""foo" + "bar""#)?, "foobar");