summaryrefslogtreecommitdiff
path: root/_test/test_string.py
diff options
context:
space:
mode:
Diffstat (limited to '_test/test_string.py')
-rw-r--r--_test/test_string.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/_test/test_string.py b/_test/test_string.py
index 5aa0700..13474b5 100644
--- a/_test/test_string.py
+++ b/_test/test_string.py
@@ -22,13 +22,13 @@ import platform
from roundtrip import round_trip, dedent, round_trip_load, round_trip_dump # NOQA
-class TestYAML:
+class TestPreservedScalarString:
def test_basic_string(self):
round_trip("""
a: abcdefg
""", )
- def test_quoted_string(self):
+ def test_quoted_integer_string(self):
round_trip("""
a: '12345'
""")
@@ -105,3 +105,22 @@ class TestYAML:
def
""", intermediate=dict(a='abc def\n\n'))
+
+
+class TestQuotedScalarString:
+ def test_single_quoted_string(self):
+ round_trip("""
+ a: 'abc'
+ """, preserve_quotes=True)
+
+ def test_double_quoted_string(self):
+ round_trip("""
+ a: "abc"
+ """, preserve_quotes=True)
+
+ def test_non_preserved_double_quoted_string(self):
+ round_trip("""
+ a: "abc"
+ """, outp="""
+ a: abc
+ """)