diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-12-30 17:34:11 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-12-30 17:34:11 -0800 |
| commit | f6992255dff64e42e690a2ab02bf3ea054157dd2 (patch) | |
| tree | f1bac1a4c478cde0aab705690d396a31c5b3a57e /src/lib.rs | |
| parent | ed5c31ee2915dfc42e1ac08f2e1f58ab0625ee4f (diff) | |
| download | milf-rs-f6992255dff64e42e690a2ab02bf3ea054157dd2.tar.gz milf-rs-f6992255dff64e42e690a2ab02bf3ea054157dd2.zip | |
Escape control characters when encoding strings
Closes #126
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -489,4 +489,10 @@ mod tests { assert_eq!(Value::Integer(0), *value.lookup("table.\"element\".\"value\".0").unwrap()); } + #[test] + fn control_characters() { + let value = Value::String("\x05".to_string()); + assert_eq!(value.to_string(), r#""\u0005""#); + } + } |