diff options
Diffstat (limited to 'tests/valid')
-rw-r--r-- | tests/valid/arrays-hetergeneous.json | 4 | ||||
-rw-r--r-- | tests/valid/arrays-hetergeneous.toml | 2 | ||||
-rw-r--r-- | tests/valid/arrays.json | 6 | ||||
-rw-r--r-- | tests/valid/arrays.toml | 3 | ||||
-rw-r--r-- | tests/valid/key-space.json | 3 | ||||
-rw-r--r-- | tests/valid/key-space.toml | 1 | ||||
-rw-r--r-- | tests/valid/multiline-string.json | 30 | ||||
-rw-r--r-- | tests/valid/multiline-string.toml | 23 | ||||
-rw-r--r-- | tests/valid/raw-multiline-string.json | 14 | ||||
-rw-r--r-- | tests/valid/raw-multiline-string.toml | 9 | ||||
-rw-r--r-- | tests/valid/raw-string.json | 30 | ||||
-rw-r--r-- | tests/valid/raw-string.toml | 7 | ||||
-rw-r--r-- | tests/valid/string-escapes.json | 16 | ||||
-rw-r--r-- | tests/valid/string-escapes.toml | 4 | ||||
-rw-r--r-- | tests/valid/unicode-escape.json | 3 | ||||
-rw-r--r-- | tests/valid/unicode-escape.toml | 3 |
16 files changed, 148 insertions, 10 deletions
diff --git a/tests/valid/arrays-hetergeneous.json b/tests/valid/arrays-hetergeneous.json index e703739..478fa5c 100644 --- a/tests/valid/arrays-hetergeneous.json +++ b/tests/valid/arrays-hetergeneous.json @@ -11,8 +11,8 @@ {"type": "string", "value": "b"} ]}, {"type": "array", "value": [ - {"type": "float", "value": "1.0"}, - {"type": "float", "value": "2.0"} + {"type": "float", "value": "1.1"}, + {"type": "float", "value": "2.1"} ]} ] } diff --git a/tests/valid/arrays-hetergeneous.toml b/tests/valid/arrays-hetergeneous.toml index 91fcbdf..a246fcf 100644 --- a/tests/valid/arrays-hetergeneous.toml +++ b/tests/valid/arrays-hetergeneous.toml @@ -1 +1 @@ -mixed = [[1, 2], ["a", "b"], [1.0, 2.0]] +mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/tests/valid/arrays.json b/tests/valid/arrays.json index 4d16d8a..58aedbc 100644 --- a/tests/valid/arrays.json +++ b/tests/valid/arrays.json @@ -10,9 +10,9 @@ "floats": { "type": "array", "value": [ - {"type": "float", "value": "1.0"}, - {"type": "float", "value": "2.0"}, - {"type": "float", "value": "3.0"} + {"type": "float", "value": "1.1"}, + {"type": "float", "value": "2.1"}, + {"type": "float", "value": "3.1"} ] }, "strings": { diff --git a/tests/valid/arrays.toml b/tests/valid/arrays.toml index 6d6440d..c435f57 100644 --- a/tests/valid/arrays.toml +++ b/tests/valid/arrays.toml @@ -1,9 +1,8 @@ ints = [1, 2, 3] -floats = [1.0, 2.0, 3.0] +floats = [1.1, 2.1, 3.1] strings = ["a", "b", "c"] dates = [ 1987-07-05T17:45:00Z, 1979-05-27T07:32:00Z, 2006-06-01T11:00:00Z, ] - diff --git a/tests/valid/key-space.json b/tests/valid/key-space.json new file mode 100644 index 0000000..9d1f769 --- /dev/null +++ b/tests/valid/key-space.json @@ -0,0 +1,3 @@ +{ + "a b": {"type": "integer", "value": "1"} +} diff --git a/tests/valid/key-space.toml b/tests/valid/key-space.toml new file mode 100644 index 0000000..f4f36c4 --- /dev/null +++ b/tests/valid/key-space.toml @@ -0,0 +1 @@ +"a b" = 1 diff --git a/tests/valid/multiline-string.json b/tests/valid/multiline-string.json new file mode 100644 index 0000000..075bf50 --- /dev/null +++ b/tests/valid/multiline-string.json @@ -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." + } +} diff --git a/tests/valid/multiline-string.toml b/tests/valid/multiline-string.toml new file mode 100644 index 0000000..15b1143 --- /dev/null +++ b/tests/valid/multiline-string.toml @@ -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.\ + """ diff --git a/tests/valid/raw-multiline-string.json b/tests/valid/raw-multiline-string.json new file mode 100644 index 0000000..b43cce5 --- /dev/null +++ b/tests/valid/raw-multiline-string.json @@ -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." + } +} diff --git a/tests/valid/raw-multiline-string.toml b/tests/valid/raw-multiline-string.toml new file mode 100644 index 0000000..8094c03 --- /dev/null +++ b/tests/valid/raw-multiline-string.toml @@ -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.''' diff --git a/tests/valid/raw-string.json b/tests/valid/raw-string.json new file mode 100644 index 0000000..693ab9b --- /dev/null +++ b/tests/valid/raw-string.json @@ -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." + } +} diff --git a/tests/valid/raw-string.toml b/tests/valid/raw-string.toml new file mode 100644 index 0000000..92acd25 --- /dev/null +++ b/tests/valid/raw-string.toml @@ -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.' diff --git a/tests/valid/string-escapes.json b/tests/valid/string-escapes.json index ca71d30..62dac51 100644 --- a/tests/valid/string-escapes.json +++ b/tests/valid/string-escapes.json @@ -30,5 +30,21 @@ "backslash": { "type": "string", "value": "This string has a \u005C backslash character." + }, + "notunicode1": { + "type": "string", + "value": "This string does not have a unicode \\u escape." + }, + "notunicode2": { + "type": "string", + "value": "This string does not have a unicode \u005Cu escape." + }, + "notunicode3": { + "type": "string", + "value": "This string does not have a unicode \\u0075 escape." + }, + "notunicode4": { + "type": "string", + "value": "This string does not have a unicode \\\u0075 escape." } } diff --git a/tests/valid/string-escapes.toml b/tests/valid/string-escapes.toml index 9f9a8c0..c5d4954 100644 --- a/tests/valid/string-escapes.toml +++ b/tests/valid/string-escapes.toml @@ -6,3 +6,7 @@ carriage = "This string has a \r carriage return character." quote = "This string has a \" quote character." slash = "This string has a / slash character." backslash = "This string has a \\ backslash character." +notunicode1 = "This string does not have a unicode \\u escape." +notunicode2 = "This string does not have a unicode \u005Cu escape." +notunicode3 = "This string does not have a unicode \\u0075 escape." +notunicode4 = "This string does not have a unicode \\\u0075 escape." diff --git a/tests/valid/unicode-escape.json b/tests/valid/unicode-escape.json index deda62c..216f8f7 100644 --- a/tests/valid/unicode-escape.json +++ b/tests/valid/unicode-escape.json @@ -1,3 +1,4 @@ { - "answer": {"type": "string", "value": "\u03B4"} + "answer4": {"type": "string", "value": "\u03B4"}, + "answer8": {"type": "string", "value": "\u03B4"} } diff --git a/tests/valid/unicode-escape.toml b/tests/valid/unicode-escape.toml index 057ce15..82faecb 100644 --- a/tests/valid/unicode-escape.toml +++ b/tests/valid/unicode-escape.toml @@ -1 +1,2 @@ -answer = "\u03B4" +answer4 = "\u03B4" +answer8 = "\U000003B4" |