aboutsummaryrefslogtreecommitdiff
path: root/tests/pretty.rs
diff options
context:
space:
mode:
authorGarrett Berg <vitiral@gmail.com>2017-07-27 16:37:30 -0600
committerGarrett Berg <vitiral@gmail.com>2017-07-27 22:01:36 -0600
commit9548288de5dca4d765eba0755955108009294951 (patch)
treef3efb8e7deeb18487c30d1f53e8d691dad052163 /tests/pretty.rs
parent1a770fdb229621c1f62c4ea6ea9ab61cb7f0befe (diff)
downloadmilf-rs-9548288de5dca4d765eba0755955108009294951.tar.gz
milf-rs-9548288de5dca4d765eba0755955108009294951.zip
fix bugs with pretty
Diffstat (limited to 'tests/pretty.rs')
-rw-r--r--tests/pretty.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pretty.rs b/tests/pretty.rs
index ae9a839..f7d1612 100644
--- a/tests/pretty.rs
+++ b/tests/pretty.rs
@@ -166,3 +166,22 @@ fn pretty_no_string() {
}
assert_eq!(toml, &result);
}
+
+const PRETTY_TRICKY: &'static str = r"[example]
+text = '''
+this is the first line
+This has a ''\' in it for no reason
+this is the third line
+'''
+";
+
+#[test]
+fn pretty_tricky() {
+ let toml = PRETTY_TRICKY;
+ let value: toml::Value = toml::from_str(toml).unwrap();
+ let mut result = String::with_capacity(128);
+ value.serialize(&mut toml::Serializer::pretty(&mut result)).unwrap();
+ println!("EXPECTED:\n{}", toml);
+ println!("\nRESULT:\n{}", result);
+ assert_eq!(toml, &result);
+}