aboutsummaryrefslogtreecommitdiff
path: root/tests/pretty.rs
diff options
context:
space:
mode:
authorGarrett Berg <vitiral@gmail.com>2017-07-28 09:12:21 -0600
committerGarrett Berg <vitiral@gmail.com>2017-07-28 09:25:53 -0600
commitca81a4a291930aa25637cf814b2f760f4e9d487d (patch)
tree0a31778707796afe24b418ca1dc7a32d0ca1d84d /tests/pretty.rs
parenta29c1eeef04eed525d7fe48b8e06ae31c0a60575 (diff)
downloadmilf-rs-ca81a4a291930aa25637cf814b2f760f4e9d487d.tar.gz
milf-rs-ca81a4a291930aa25637cf814b2f760f4e9d487d.zip
add """ for non-literals with newlines, clean up logic and add tests
Diffstat (limited to 'tests/pretty.rs')
-rw-r--r--tests/pretty.rs32
1 files changed, 25 insertions, 7 deletions
diff --git a/tests/pretty.rs b/tests/pretty.rs
index 308772d..cceb815 100644
--- a/tests/pretty.rs
+++ b/tests/pretty.rs
@@ -175,14 +175,32 @@ fn pretty_no_string() {
assert_eq!(toml, &result);
}
-const PRETTY_TRICKY: &'static str = r"[example]
-single = '''this is a single line but has '' for no reason'''
-text = '''
-this is the first line
-This has a ''\' in it for no reason
-this is the third line
+const PRETTY_TRICKY: &'static str = r##"[example]
+f = "\f"
+glass = '''
+Nothing too unusual, except that I can eat glass in:
+- Greek: Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα.
+- Polish: Mogę jeść szkło, i mi nie szkodzi.
+- Hindi: मैं काँच खा सकता हूँ, मुझे उस से कोई पीडा नहीं होती.
+- Japanese: 私はガラスを食べられます。それは私を傷つけません。
'''
-";
+r = "\r"
+r_newline = """
+\r
+"""
+single = '''this is a single line but has '' cuz it's tricky'''
+single_tricky = "single line with ''' in it"
+tabs = '''
+this is pretty standard
+ except for some tabs right here
+'''
+text = """
+this is the first line.
+This has a ''' in it and \"\"\" cuz it's tricky yo
+Also ' and \" because why not
+this is the third line
+"""
+"##;
#[test]
fn pretty_tricky() {