Add "" and `` in string literals.
This commit is contained in:
@@ -8,6 +8,10 @@ fn test_string() -> Result<(), Box<EvalAltResult>> {
|
||||
engine.eval::<String>(r#""Test string: \u2764""#)?,
|
||||
"Test string: ❤"
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<String>(r#""Test string: ""\u2764""""#)?,
|
||||
r#"Test string: "❤""#
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<String>("\"Test\rstring: \\u2764\"")?,
|
||||
"Test\rstring: ❤"
|
||||
@@ -24,6 +28,10 @@ fn test_string() -> Result<(), Box<EvalAltResult>> {
|
||||
engine.eval::<String>(" `Test string: \\u2764\nhello,\\nworld!`")?,
|
||||
"Test string: \\u2764\nhello,\\nworld!"
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<String>(r#" `Test string: \\u2764\n``hello``,\\n"world"!`"#)?,
|
||||
r#"Test string: \\u2764\n`hello`,\\n"world"!"#
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<String>(" `\nTest string: \\u2764\nhello,\\nworld!`")?,
|
||||
"Test string: \\u2764\nhello,\\nworld!"
|
||||
|
Reference in New Issue
Block a user