mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-12-29 11:42:15 +00:00
Added multiline and raw string tests from BurntSushi
This commit is contained in:
parent
4eb948b694
commit
39300478f1
7 changed files with 128 additions and 0 deletions
|
@ -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");
|
||||
|
|
|
@ -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."
|
||||
}
|
||||
}
|
|
@ -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.\
|
||||
"""
|
|
@ -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."
|
||||
}
|
||||
}
|
|
@ -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.'''
|
|
@ -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."
|
||||
}
|
||||
}
|
|
@ -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.'
|
Loading…
Reference in a new issue