Added multiline and raw string tests from BurntSushi

This commit is contained in:
moandji.ezana 2014-11-02 13:22:20 +02:00
parent 4eb948b694
commit 39300478f1
7 changed files with 128 additions and 0 deletions

View file

@ -133,6 +133,21 @@ public class BurntSushiValidTest {
run("long-integer");
}
@Test
public void multiline_string() throws Exception {
run("multiline-string");
}
@Test
public void raw_multiline_string() throws Exception {
run("raw-multiline-string");
}
@Test
public void raw_string() throws Exception {
run("raw-string");
}
@Test
public void string_empty() throws Exception {
run("string-empty");

View file

@ -0,0 +1,30 @@
{
"multiline empty one": {
"type": "string",
"value": ""
},
"multiline empty two": {
"type": "string",
"value": ""
},
"multiline empty three": {
"type": "string",
"value": ""
},
"multiline empty four": {
"type": "string",
"value": ""
},
"equivalent one": {
"type": "string",
"value": "The quick brown fox jumps over the lazy dog."
},
"equivalent two": {
"type": "string",
"value": "The quick brown fox jumps over the lazy dog."
},
"equivalent three": {
"type": "string",
"value": "The quick brown fox jumps over the lazy dog."
}
}

View file

@ -0,0 +1,23 @@
multiline empty one = """"""
multiline empty two = """
"""
multiline empty three = """\
"""
multiline empty four = """\
\
\
"""
equivalent one = "The quick brown fox jumps over the lazy dog."
equivalent two = """
The quick brown \
fox jumps over \
the lazy dog."""
equivalent three = """\
The quick brown \
fox jumps over \
the lazy dog.\
"""

View file

@ -0,0 +1,14 @@
{
"oneline": {
"type": "string",
"value": "This string has a ' quote character."
},
"firstnl": {
"type": "string",
"value": "This string has a ' quote character."
},
"multiline": {
"type": "string",
"value": "This string\nhas ' a quote character\nand more than\none newline\nin it."
}
}

View file

@ -0,0 +1,9 @@
oneline = '''This string has a ' quote character.'''
firstnl = '''
This string has a ' quote character.'''
multiline = '''
This string
has ' a quote character
and more than
one newline
in it.'''

View file

@ -0,0 +1,30 @@
{
"backspace": {
"type": "string",
"value": "This string has a \\b backspace character."
},
"tab": {
"type": "string",
"value": "This string has a \\t tab character."
},
"newline": {
"type": "string",
"value": "This string has a \\n new line character."
},
"formfeed": {
"type": "string",
"value": "This string has a \\f form feed character."
},
"carriage": {
"type": "string",
"value": "This string has a \\r carriage return character."
},
"slash": {
"type": "string",
"value": "This string has a \\/ slash character."
},
"backslash": {
"type": "string",
"value": "This string has a \\\\ backslash character."
}
}

View file

@ -0,0 +1,7 @@
backspace = 'This string has a \b backspace character.'
tab = 'This string has a \t tab character.'
newline = 'This string has a \n new line character.'
formfeed = 'This string has a \f form feed character.'
carriage = 'This string has a \r carriage return character.'
slash = 'This string has a \/ slash character.'
backslash = 'This string has a \\ backslash character.'