diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:21:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:21:29 +0000 |
commit | 683f1f3ddde13390781318b9fe4a6841ea35d145 (patch) | |
tree | c21fddf99f2e5233bb3f22bbafd0d711fe7c5d95 /tests/data/valid/burntsushi | |
parent | Initial commit. (diff) | |
download | python-tomli-683f1f3ddde13390781318b9fe4a6841ea35d145.tar.xz python-tomli-683f1f3ddde13390781318b9fe4a6841ea35d145.zip |
Adding upstream version 2.0.1.upstream/2.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/data/valid/burntsushi')
197 files changed, 2936 insertions, 0 deletions
diff --git a/tests/data/valid/burntsushi/COPYING b/tests/data/valid/burntsushi/COPYING new file mode 100644 index 0000000..93b2202 --- /dev/null +++ b/tests/data/valid/burntsushi/COPYING @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 TOML authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tests/data/valid/burntsushi/valid/array/array.json b/tests/data/valid/burntsushi/valid/array/array.json new file mode 100644 index 0000000..4e9d45b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/array.json @@ -0,0 +1,68 @@ +{ + "comments": [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + } + ], + "dates": [ + { + "type": "datetime", + "value": "1987-07-05T17:45:00Z" + }, + { + "type": "datetime", + "value": "1979-05-27T07:32:00Z" + }, + { + "type": "datetime", + "value": "2006-06-01T11:00:00Z" + } + ], + "floats": [ + { + "type": "float", + "value": "1.1" + }, + { + "type": "float", + "value": "2.1" + }, + { + "type": "float", + "value": "3.1" + } + ], + "ints": [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + }, + { + "type": "integer", + "value": "3" + } + ], + "strings": [ + { + "type": "string", + "value": "a" + }, + { + "type": "string", + "value": "b" + }, + { + "type": "string", + "value": "c" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/array.toml b/tests/data/valid/burntsushi/valid/array/array.toml new file mode 100644 index 0000000..ab88465 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/array.toml @@ -0,0 +1,12 @@ +ints = [1, 2, 3, ] +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, +] +comments = [ + 1, + 2, #this is ok +] diff --git a/tests/data/valid/burntsushi/valid/array/bool.json b/tests/data/valid/burntsushi/valid/array/bool.json new file mode 100644 index 0000000..7cede3f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/bool.json @@ -0,0 +1,12 @@ +{ + "a": [ + { + "type": "bool", + "value": "true" + }, + { + "type": "bool", + "value": "false" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/bool.toml b/tests/data/valid/burntsushi/valid/array/bool.toml new file mode 100644 index 0000000..d2010c5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/bool.toml @@ -0,0 +1 @@ +a = [true, false] diff --git a/tests/data/valid/burntsushi/valid/array/empty.json b/tests/data/valid/burntsushi/valid/array/empty.json new file mode 100644 index 0000000..7b1ca0c --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/empty.json @@ -0,0 +1,11 @@ +{ + "thevoid": [ + [ + [ + [ + [] + ] + ] + ] + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/empty.toml b/tests/data/valid/burntsushi/valid/array/empty.toml new file mode 100644 index 0000000..fa58dc6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/empty.toml @@ -0,0 +1 @@ +thevoid = [[[[[]]]]] diff --git a/tests/data/valid/burntsushi/valid/array/hetergeneous.json b/tests/data/valid/burntsushi/valid/array/hetergeneous.json new file mode 100644 index 0000000..751b624 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/hetergeneous.json @@ -0,0 +1,34 @@ +{ + "mixed": [ + [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + } + ], + [ + { + "type": "string", + "value": "a" + }, + { + "type": "string", + "value": "b" + } + ], + [ + { + "type": "float", + "value": "1.1" + }, + { + "type": "float", + "value": "2.1" + } + ] + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/hetergeneous.toml b/tests/data/valid/burntsushi/valid/array/hetergeneous.toml new file mode 100644 index 0000000..a246fcf --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/hetergeneous.toml @@ -0,0 +1 @@ +mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/tests/data/valid/burntsushi/valid/array/mixed-int-array.json b/tests/data/valid/burntsushi/valid/array/mixed-int-array.json new file mode 100644 index 0000000..2f3ac5e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-int-array.json @@ -0,0 +1,14 @@ +{ + "arrays-and-ints": [ + { + "type": "integer", + "value": "1" + }, + [ + { + "type": "string", + "value": "Arrays are not integers." + } + ] + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/mixed-int-array.toml b/tests/data/valid/burntsushi/valid/array/mixed-int-array.toml new file mode 100644 index 0000000..051ec73 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-int-array.toml @@ -0,0 +1 @@ +arrays-and-ints = [1, ["Arrays are not integers."]] diff --git a/tests/data/valid/burntsushi/valid/array/mixed-int-float.json b/tests/data/valid/burntsushi/valid/array/mixed-int-float.json new file mode 100644 index 0000000..e73059b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-int-float.json @@ -0,0 +1,12 @@ +{ + "ints-and-floats": [ + { + "type": "integer", + "value": "1" + }, + { + "type": "float", + "value": "1.1" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/mixed-int-float.toml b/tests/data/valid/burntsushi/valid/array/mixed-int-float.toml new file mode 100644 index 0000000..a5aa9b7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-int-float.toml @@ -0,0 +1 @@ +ints-and-floats = [1, 1.1] diff --git a/tests/data/valid/burntsushi/valid/array/mixed-int-string.json b/tests/data/valid/burntsushi/valid/array/mixed-int-string.json new file mode 100644 index 0000000..c6acc76 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-int-string.json @@ -0,0 +1,12 @@ +{ + "strings-and-ints": [ + { + "type": "string", + "value": "hi" + }, + { + "type": "integer", + "value": "42" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/mixed-int-string.toml b/tests/data/valid/burntsushi/valid/array/mixed-int-string.toml new file mode 100644 index 0000000..f348308 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-int-string.toml @@ -0,0 +1 @@ +strings-and-ints = ["hi", 42] diff --git a/tests/data/valid/burntsushi/valid/array/mixed-string-table.json b/tests/data/valid/burntsushi/valid/array/mixed-string-table.json new file mode 100644 index 0000000..6185aa9 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-string-table.json @@ -0,0 +1,22 @@ +{ + "contributors": [ + { + "type": "string", + "value": "Foo Bar \u003cfoo@example.com\u003e" + }, + { + "email": { + "type": "string", + "value": "bazqux@example.com" + }, + "name": { + "type": "string", + "value": "Baz Qux" + }, + "url": { + "type": "string", + "value": "https://example.com/bazqux" + } + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/mixed-string-table.toml b/tests/data/valid/burntsushi/valid/array/mixed-string-table.toml new file mode 100644 index 0000000..bd7ada8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/mixed-string-table.toml @@ -0,0 +1,4 @@ +contributors = [ + "Foo Bar <foo@example.com>", + { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } +] diff --git a/tests/data/valid/burntsushi/valid/array/nested-double.json b/tests/data/valid/burntsushi/valid/array/nested-double.json new file mode 100644 index 0000000..c89a8c9 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nested-double.json @@ -0,0 +1,28 @@ +{ + "nest": [ + [ + [ + { + "type": "string", + "value": "a" + } + ], + [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + }, + [ + { + "type": "integer", + "value": "3" + } + ] + ] + ] + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/nested-double.toml b/tests/data/valid/burntsushi/valid/array/nested-double.toml new file mode 100644 index 0000000..c1de747 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nested-double.toml @@ -0,0 +1,6 @@ +nest = [ + [ + ["a"], + [1, 2, [3]] + ] +] diff --git a/tests/data/valid/burntsushi/valid/array/nested-inline-table.json b/tests/data/valid/burntsushi/valid/array/nested-inline-table.json new file mode 100644 index 0000000..2ae5fa7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nested-inline-table.json @@ -0,0 +1,7 @@ +{ + "a": [ + { + "b": {} + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/nested-inline-table.toml b/tests/data/valid/burntsushi/valid/array/nested-inline-table.toml new file mode 100644 index 0000000..e1e24f6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nested-inline-table.toml @@ -0,0 +1 @@ +a = [ { b = {} } ] diff --git a/tests/data/valid/burntsushi/valid/array/nested.json b/tests/data/valid/burntsushi/valid/array/nested.json new file mode 100644 index 0000000..72c7589 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nested.json @@ -0,0 +1,16 @@ +{ + "nest": [ + [ + { + "type": "string", + "value": "a" + } + ], + [ + { + "type": "string", + "value": "b" + } + ] + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/nested.toml b/tests/data/valid/burntsushi/valid/array/nested.toml new file mode 100644 index 0000000..ce33022 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nested.toml @@ -0,0 +1 @@ +nest = [["a"], ["b"]] diff --git a/tests/data/valid/burntsushi/valid/array/nospaces.json b/tests/data/valid/burntsushi/valid/array/nospaces.json new file mode 100644 index 0000000..6c89fce --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nospaces.json @@ -0,0 +1,16 @@ +{ + "ints": [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + }, + { + "type": "integer", + "value": "3" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/nospaces.toml b/tests/data/valid/burntsushi/valid/array/nospaces.toml new file mode 100644 index 0000000..6618936 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/nospaces.toml @@ -0,0 +1 @@ +ints = [1,2,3] diff --git a/tests/data/valid/burntsushi/valid/array/string-quote-comma-2.json b/tests/data/valid/burntsushi/valid/array/string-quote-comma-2.json new file mode 100644 index 0000000..7cd5406 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/string-quote-comma-2.json @@ -0,0 +1,8 @@ +{ + "title": [ + { + "type": "string", + "value": " \", " + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/string-quote-comma-2.toml b/tests/data/valid/burntsushi/valid/array/string-quote-comma-2.toml new file mode 100644 index 0000000..4758ddc --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/string-quote-comma-2.toml @@ -0,0 +1 @@ +title = [ " \", ",] diff --git a/tests/data/valid/burntsushi/valid/array/string-quote-comma.json b/tests/data/valid/burntsushi/valid/array/string-quote-comma.json new file mode 100644 index 0000000..b78db42 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/string-quote-comma.json @@ -0,0 +1,12 @@ +{ + "title": [ + { + "type": "string", + "value": "Client: \"XXXX\", Job: XXXX" + }, + { + "type": "string", + "value": "Code: XXXX" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/string-quote-comma.toml b/tests/data/valid/burntsushi/valid/array/string-quote-comma.toml new file mode 100644 index 0000000..6b458e1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/string-quote-comma.toml @@ -0,0 +1,4 @@ +title = [ +"Client: \"XXXX\", Job: XXXX", +"Code: XXXX" +] diff --git a/tests/data/valid/burntsushi/valid/array/string-with-comma.json b/tests/data/valid/burntsushi/valid/array/string-with-comma.json new file mode 100644 index 0000000..42b77ef --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/string-with-comma.json @@ -0,0 +1,12 @@ +{ + "title": [ + { + "type": "string", + "value": "Client: XXXX, Job: XXXX" + }, + { + "type": "string", + "value": "Code: XXXX" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/string-with-comma.toml b/tests/data/valid/burntsushi/valid/array/string-with-comma.toml new file mode 100644 index 0000000..655c40e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/string-with-comma.toml @@ -0,0 +1,4 @@ +title = [ +"Client: XXXX, Job: XXXX", +"Code: XXXX" +] diff --git a/tests/data/valid/burntsushi/valid/array/strings.json b/tests/data/valid/burntsushi/valid/array/strings.json new file mode 100644 index 0000000..27617b4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/strings.json @@ -0,0 +1,20 @@ +{ + "string_array": [ + { + "type": "string", + "value": "all" + }, + { + "type": "string", + "value": "strings" + }, + { + "type": "string", + "value": "are the same" + }, + { + "type": "string", + "value": "type" + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/strings.toml b/tests/data/valid/burntsushi/valid/array/strings.toml new file mode 100644 index 0000000..51894ce --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/strings.toml @@ -0,0 +1 @@ +string_array = [ "all", 'strings', """are the same""", '''type'''] diff --git a/tests/data/valid/burntsushi/valid/array/table-array-string-backslash.json b/tests/data/valid/burntsushi/valid/array/table-array-string-backslash.json new file mode 100644 index 0000000..2c0feb1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/table-array-string-backslash.json @@ -0,0 +1,10 @@ +{ + "foo": [ + { + "bar": { + "type": "string", + "value": "\"{{baz}}\"" + } + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/array/table-array-string-backslash.toml b/tests/data/valid/burntsushi/valid/array/table-array-string-backslash.toml new file mode 100644 index 0000000..f0de81e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/array/table-array-string-backslash.toml @@ -0,0 +1 @@ +foo = [ { bar="\"{{baz}}\""} ] diff --git a/tests/data/valid/burntsushi/valid/bool/bool.json b/tests/data/valid/burntsushi/valid/bool/bool.json new file mode 100644 index 0000000..be47d6d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/bool/bool.json @@ -0,0 +1,10 @@ +{ + "f": { + "type": "bool", + "value": "false" + }, + "t": { + "type": "bool", + "value": "true" + } +} diff --git a/tests/data/valid/burntsushi/valid/bool/bool.toml b/tests/data/valid/burntsushi/valid/bool/bool.toml new file mode 100644 index 0000000..a8a829b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/bool/bool.toml @@ -0,0 +1,2 @@ +t = true +f = false diff --git a/tests/data/valid/burntsushi/valid/comment/at-eof.json b/tests/data/valid/burntsushi/valid/comment/at-eof.json new file mode 100644 index 0000000..af3154a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/at-eof.json @@ -0,0 +1,6 @@ +{ + "key": { + "type": "string", + "value": "value" + } +} diff --git a/tests/data/valid/burntsushi/valid/comment/at-eof.toml b/tests/data/valid/burntsushi/valid/comment/at-eof.toml new file mode 100644 index 0000000..090b474 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/at-eof.toml @@ -0,0 +1,2 @@ +# This is a full-line comment +key = "value" # This is a comment at the end of a line diff --git a/tests/data/valid/burntsushi/valid/comment/at-eof2.json b/tests/data/valid/burntsushi/valid/comment/at-eof2.json new file mode 100644 index 0000000..af3154a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/at-eof2.json @@ -0,0 +1,6 @@ +{ + "key": { + "type": "string", + "value": "value" + } +} diff --git a/tests/data/valid/burntsushi/valid/comment/at-eof2.toml b/tests/data/valid/burntsushi/valid/comment/at-eof2.toml new file mode 100644 index 0000000..090b474 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/at-eof2.toml @@ -0,0 +1,2 @@ +# This is a full-line comment +key = "value" # This is a comment at the end of a line diff --git a/tests/data/valid/burntsushi/valid/comment/everywhere.json b/tests/data/valid/burntsushi/valid/comment/everywhere.json new file mode 100644 index 0000000..6e714d1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/everywhere.json @@ -0,0 +1,26 @@ +{ + "group": { + "answer": { + "type": "integer", + "value": "42" + }, + "dt": { + "type": "datetime", + "value": "1979-05-27T07:32:12-07:00" + }, + "d": { + "type": "date-local", + "value": "1979-05-27" + }, + "more": [ + { + "type": "integer", + "value": "42" + }, + { + "type": "integer", + "value": "42" + } + ] + } +} diff --git a/tests/data/valid/burntsushi/valid/comment/everywhere.toml b/tests/data/valid/burntsushi/valid/comment/everywhere.toml new file mode 100644 index 0000000..a5da1d7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/everywhere.toml @@ -0,0 +1,28 @@ +# Top comment. + # Top comment. +# Top comment. + +# [no-extraneous-groups-please] + +[group] # Comment +answer = 42 # Comment +# no-extraneous-keys-please = 999 +# Inbetween comment. +more = [ # Comment + # What about multiple # comments? + # Can you handle it? + # + # Evil. +# Evil. + 42, 42, # Comments within arrays are fun. + # What about multiple # comments? + # Can you handle it? + # + # Evil. +# Evil. +# ] Did I fool you? +] # Hopefully not. + +# Make sure the space between the datetime and "#" isn't lexed. +dt = 1979-05-27T07:32:12-07:00 # c +d = 1979-05-27 # Comment diff --git a/tests/data/valid/burntsushi/valid/comment/noeol.json b/tests/data/valid/burntsushi/valid/comment/noeol.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/noeol.json @@ -0,0 +1 @@ +{} diff --git a/tests/data/valid/burntsushi/valid/comment/noeol.toml b/tests/data/valid/burntsushi/valid/comment/noeol.toml new file mode 100644 index 0000000..7662df8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/noeol.toml @@ -0,0 +1 @@ +# single comment without any eol characters
\ No newline at end of file diff --git a/tests/data/valid/burntsushi/valid/comment/tricky.json b/tests/data/valid/burntsushi/valid/comment/tricky.json new file mode 100644 index 0000000..0994864 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/tricky.json @@ -0,0 +1,98 @@ +{ + "hash#tag": { + "#!": { + "type": "string", + "value": "hash bang" + }, + "arr3": [ + { + "type": "string", + "value": "#" + }, + { + "type": "string", + "value": "#" + }, + { + "type": "string", + "value": "###" + } + ], + "arr4": [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + }, + { + "type": "integer", + "value": "3" + }, + { + "type": "integer", + "value": "4" + } + ], + "arr5": [ + [ + [ + [ + [ + { + "type": "string", + "value": "#" + } + ] + ] + ] + ] + ], + "tbl1": { + "#": { + "type": "string", + "value": "}#" + } + } + }, + "section": { + "8": { + "type": "string", + "value": "eight" + }, + "eleven": { + "type": "float", + "value": "11.1" + }, + "five": { + "type": "float", + "value": "5.5" + }, + "four": { + "type": "string", + "value": "# no comment\n# nor this\n#also not comment" + }, + "one": { + "type": "string", + "value": "11" + }, + "six": { + "type": "integer", + "value": "6" + }, + "ten": { + "type": "float", + "value": "1000.0" + }, + "three": { + "type": "string", + "value": "#" + }, + "two": { + "type": "string", + "value": "22#" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/comment/tricky.toml b/tests/data/valid/burntsushi/valid/comment/tricky.toml new file mode 100644 index 0000000..c95f94d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/comment/tricky.toml @@ -0,0 +1,31 @@ +[section]#attached comment +#[notsection] +one = "11"#cmt +two = "22#" +three = '#' + +four = """# no comment +# nor this +#also not comment"""#is_comment + +five = 5.5#66 +six = 6#7 +8 = "eight" +#nine = 99 +ten = 10e2#1 +eleven = 1.11e1#23 + +["hash#tag"] +"#!" = "hash bang" +arr3 = [ "#", '#', """###""" ] +arr4 = [ 1,# 9, 9, +2#,9 +,#9 +3#] +,4] +arr5 = [[[[#["#"], +["#"]]]]#] +] +tbl1 = { "#" = '}#'}#}} + + diff --git a/tests/data/valid/burntsushi/valid/datetime/datetime.json b/tests/data/valid/burntsushi/valid/datetime/datetime.json new file mode 100644 index 0000000..5146335 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/datetime.json @@ -0,0 +1,10 @@ +{ + "lower": { + "type": "datetime", + "value": "1987-07-05T17:45:00Z" + }, + "space": { + "type": "datetime", + "value": "1987-07-05T17:45:00Z" + } +} diff --git a/tests/data/valid/burntsushi/valid/datetime/datetime.toml b/tests/data/valid/burntsushi/valid/datetime/datetime.toml new file mode 100644 index 0000000..653d521 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/datetime.toml @@ -0,0 +1,2 @@ +space = 1987-07-05 17:45:00Z +lower = 1987-07-05t17:45:00z diff --git a/tests/data/valid/burntsushi/valid/datetime/local-date.json b/tests/data/valid/burntsushi/valid/datetime/local-date.json new file mode 100644 index 0000000..8fea2fe --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/local-date.json @@ -0,0 +1,6 @@ +{ + "bestdayever": { + "type": "date-local", + "value": "1987-07-05" + } +} diff --git a/tests/data/valid/burntsushi/valid/datetime/local-date.toml b/tests/data/valid/burntsushi/valid/datetime/local-date.toml new file mode 100644 index 0000000..1be4a5f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/local-date.toml @@ -0,0 +1 @@ +bestdayever = 1987-07-05 diff --git a/tests/data/valid/burntsushi/valid/datetime/local-time.json b/tests/data/valid/burntsushi/valid/datetime/local-time.json new file mode 100644 index 0000000..5e527e9 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/local-time.json @@ -0,0 +1,10 @@ +{ + "besttimeever": { + "type": "time-local", + "value": "17:45:00" + }, + "milliseconds": { + "type": "time-local", + "value": "10:32:00.555" + } +} diff --git a/tests/data/valid/burntsushi/valid/datetime/local-time.toml b/tests/data/valid/burntsushi/valid/datetime/local-time.toml new file mode 100644 index 0000000..6b07f6f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/local-time.toml @@ -0,0 +1,2 @@ +besttimeever = 17:45:00 +milliseconds = 10:32:00.555 diff --git a/tests/data/valid/burntsushi/valid/datetime/local.json b/tests/data/valid/burntsushi/valid/datetime/local.json new file mode 100644 index 0000000..12f8df5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/local.json @@ -0,0 +1,14 @@ +{ + "local": { + "type": "datetime-local", + "value": "1987-07-05T17:45:00" + }, + "milli": { + "type": "datetime-local", + "value": "1977-12-21T10:32:00.555" + }, + "space": { + "type": "datetime-local", + "value": "1987-07-05T17:45:00" + } +} diff --git a/tests/data/valid/burntsushi/valid/datetime/local.toml b/tests/data/valid/burntsushi/valid/datetime/local.toml new file mode 100644 index 0000000..ab425ec --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/local.toml @@ -0,0 +1,3 @@ +local = 1987-07-05T17:45:00 +milli = 1977-12-21T10:32:00.555 +space = 1987-07-05 17:45:00 diff --git a/tests/data/valid/burntsushi/valid/datetime/milliseconds.json b/tests/data/valid/burntsushi/valid/datetime/milliseconds.json new file mode 100644 index 0000000..c49e400 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/milliseconds.json @@ -0,0 +1,18 @@ +{ + "utc1": { + "type": "datetime", + "value": "1987-07-05T17:45:56.1234Z" + }, + "utc2": { + "type": "datetime", + "value": "1987-07-05T17:45:56.6000Z" + }, + "wita1": { + "type": "datetime", + "value": "1987-07-05T17:45:56.1234+08:00" + }, + "wita2": { + "type": "datetime", + "value": "1987-07-05T17:45:56.6000+08:00" + } +} diff --git a/tests/data/valid/burntsushi/valid/datetime/milliseconds.toml b/tests/data/valid/burntsushi/valid/datetime/milliseconds.toml new file mode 100644 index 0000000..24b81f8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/milliseconds.toml @@ -0,0 +1,4 @@ +utc1 = 1987-07-05T17:45:56.1234Z +utc2 = 1987-07-05T17:45:56.6Z +wita1 = 1987-07-05T17:45:56.1234+08:00 +wita2 = 1987-07-05T17:45:56.6+08:00 diff --git a/tests/data/valid/burntsushi/valid/datetime/timezone.json b/tests/data/valid/burntsushi/valid/datetime/timezone.json new file mode 100644 index 0000000..8dc8328 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/timezone.json @@ -0,0 +1,18 @@ +{ + "nzdt": { + "type": "datetime", + "value": "1987-07-05T17:45:56+13:00" + }, + "nzst": { + "type": "datetime", + "value": "1987-07-05T17:45:56+12:00" + }, + "pdt": { + "type": "datetime", + "value": "1987-07-05T17:45:56-05:00" + }, + "utc": { + "type": "datetime", + "value": "1987-07-05T17:45:56Z" + } +} diff --git a/tests/data/valid/burntsushi/valid/datetime/timezone.toml b/tests/data/valid/burntsushi/valid/datetime/timezone.toml new file mode 100644 index 0000000..20f3835 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/datetime/timezone.toml @@ -0,0 +1,4 @@ +utc = 1987-07-05T17:45:56Z +pdt = 1987-07-05T17:45:56-05:00 +nzst = 1987-07-05T17:45:56+12:00 +nzdt = 1987-07-05T17:45:56+13:00 # DST diff --git a/tests/data/valid/burntsushi/valid/empty-file.json b/tests/data/valid/burntsushi/valid/empty-file.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/empty-file.json @@ -0,0 +1 @@ +{} diff --git a/tests/data/valid/burntsushi/valid/empty-file.toml b/tests/data/valid/burntsushi/valid/empty-file.toml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/empty-file.toml diff --git a/tests/data/valid/burntsushi/valid/example.json b/tests/data/valid/burntsushi/valid/example.json new file mode 100644 index 0000000..2ea95a2 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/example.json @@ -0,0 +1,26 @@ +{ + "best-day-ever": { + "type": "datetime", + "value": "1987-07-05T17:45:00Z" + }, + "numtheory": { + "boring": { + "type": "bool", + "value": "false" + }, + "perfection": [ + { + "type": "integer", + "value": "6" + }, + { + "type": "integer", + "value": "28" + }, + { + "type": "integer", + "value": "496" + } + ] + } +} diff --git a/tests/data/valid/burntsushi/valid/example.toml b/tests/data/valid/burntsushi/valid/example.toml new file mode 100644 index 0000000..8cb02e0 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/example.toml @@ -0,0 +1,5 @@ +best-day-ever = 1987-07-05T17:45:00Z + +[numtheory] +boring = false +perfection = [6, 28, 496] diff --git a/tests/data/valid/burntsushi/valid/float/exponent.json b/tests/data/valid/burntsushi/valid/float/exponent.json new file mode 100644 index 0000000..e79a6e1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/exponent.json @@ -0,0 +1,34 @@ +{ + "lower": { + "type": "float", + "value": "300.0" + }, + "minustenth": { + "type": "float", + "value": "-0.1" + }, + "neg": { + "type": "float", + "value": "0.03" + }, + "pointlower": { + "type": "float", + "value": "310.0" + }, + "pointupper": { + "type": "float", + "value": "310.0" + }, + "pos": { + "type": "float", + "value": "300.0" + }, + "upper": { + "type": "float", + "value": "300.0" + }, + "zero": { + "type": "float", + "value": "3.0" + } +} diff --git a/tests/data/valid/burntsushi/valid/float/exponent.toml b/tests/data/valid/burntsushi/valid/float/exponent.toml new file mode 100644 index 0000000..573e0a8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/exponent.toml @@ -0,0 +1,8 @@ +lower = 3e2 +upper = 3E2 +neg = 3e-2 +pos = 3E+2 +zero = 3e0 +pointlower = 3.1e2 +pointupper = 3.1E2 +minustenth = -1E-1 diff --git a/tests/data/valid/burntsushi/valid/float/float.json b/tests/data/valid/burntsushi/valid/float/float.json new file mode 100644 index 0000000..f92d8d8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/float.json @@ -0,0 +1,18 @@ +{ + "negpi": { + "type": "float", + "value": "-3.14" + }, + "pi": { + "type": "float", + "value": "3.14" + }, + "pospi": { + "type": "float", + "value": "3.14" + }, + "zero-intpart": { + "type": "float", + "value": "0.123" + } +} diff --git a/tests/data/valid/burntsushi/valid/float/float.toml b/tests/data/valid/burntsushi/valid/float/float.toml new file mode 100644 index 0000000..5f02322 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/float.toml @@ -0,0 +1,4 @@ +pi = 3.14 +pospi = +3.14 +negpi = -3.14 +zero-intpart = 0.123 diff --git a/tests/data/valid/burntsushi/valid/float/inf-and-nan.json b/tests/data/valid/burntsushi/valid/float/inf-and-nan.json new file mode 100644 index 0000000..e3f1ba3 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/inf-and-nan.json @@ -0,0 +1,26 @@ +{ + "infinity": { + "type": "float", + "value": "inf" + }, + "infinity_neg": { + "type": "float", + "value": "-inf" + }, + "infinity_plus": { + "type": "float", + "value": "+inf" + }, + "nan": { + "type": "float", + "value": "nan" + }, + "nan_neg": { + "type": "float", + "value": "nan" + }, + "nan_plus": { + "type": "float", + "value": "nan" + } +} diff --git a/tests/data/valid/burntsushi/valid/float/inf-and-nan.toml b/tests/data/valid/burntsushi/valid/float/inf-and-nan.toml new file mode 100644 index 0000000..c8f8459 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/inf-and-nan.toml @@ -0,0 +1,8 @@ +# We don't encode +nan and -nan back with the signs; many languages don't +# support a sign on NaN (it doesn't really make much sense). +nan = nan +nan_neg = -nan +nan_plus = +nan +infinity = inf +infinity_neg = -inf +infinity_plus = +inf diff --git a/tests/data/valid/burntsushi/valid/float/long.json b/tests/data/valid/burntsushi/valid/float/long.json new file mode 100644 index 0000000..73d7505 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/long.json @@ -0,0 +1,10 @@ +{ + "longpi": { + "type": "float", + "value": "3.141592653589793" + }, + "neglongpi": { + "type": "float", + "value": "-3.141592653589793" + } +} diff --git a/tests/data/valid/burntsushi/valid/float/long.toml b/tests/data/valid/burntsushi/valid/float/long.toml new file mode 100644 index 0000000..9558ae4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/long.toml @@ -0,0 +1,2 @@ +longpi = 3.141592653589793 +neglongpi = -3.141592653589793 diff --git a/tests/data/valid/burntsushi/valid/float/underscore.json b/tests/data/valid/burntsushi/valid/float/underscore.json new file mode 100644 index 0000000..f54f7b5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/underscore.json @@ -0,0 +1,14 @@ +{ + "after": { + "type": "float", + "value": "3141.5927" + }, + "before": { + "type": "float", + "value": "3141.5927" + }, + "exponent": { + "type": "float", + "value": "3.0e14" + } +} diff --git a/tests/data/valid/burntsushi/valid/float/underscore.toml b/tests/data/valid/burntsushi/valid/float/underscore.toml new file mode 100644 index 0000000..343353a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/underscore.toml @@ -0,0 +1,3 @@ +before = 3_141.5927 +after = 3141.592_7 +exponent = 3e1_4 diff --git a/tests/data/valid/burntsushi/valid/float/zero.json b/tests/data/valid/burntsushi/valid/float/zero.json new file mode 100644 index 0000000..61551e8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/zero.json @@ -0,0 +1,30 @@ +{ + "zero": { + "type": "float", + "value": "0" + }, + "signed-pos": { + "type": "float", + "value": "0" + }, + "signed-neg": { + "type": "float", + "value": "0" + }, + "exponent": { + "type": "float", + "value": "0" + }, + "exponent-two-0": { + "type": "float", + "value": "0" + }, + "exponent-signed-pos": { + "type": "float", + "value": "0" + }, + "exponent-signed-neg": { + "type": "float", + "value": "0" + } +} diff --git a/tests/data/valid/burntsushi/valid/float/zero.toml b/tests/data/valid/burntsushi/valid/float/zero.toml new file mode 100644 index 0000000..e7efb1f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/float/zero.toml @@ -0,0 +1,7 @@ +zero = 0.0 +signed-pos = +0.0 +signed-neg = -0.0 +exponent = 0e0 +exponent-two-0 = 0e00 +exponent-signed-pos = +0e0 +exponent-signed-neg = -0e0 diff --git a/tests/data/valid/burntsushi/valid/implicit-and-explicit-after.json b/tests/data/valid/burntsushi/valid/implicit-and-explicit-after.json new file mode 100644 index 0000000..663a34e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/implicit-and-explicit-after.json @@ -0,0 +1,16 @@ +{ + "a": { + "b": { + "c": { + "answer": { + "type": "integer", + "value": "42" + } + } + }, + "better": { + "type": "integer", + "value": "43" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/implicit-and-explicit-after.toml b/tests/data/valid/burntsushi/valid/implicit-and-explicit-after.toml new file mode 100644 index 0000000..c0e8865 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/implicit-and-explicit-after.toml @@ -0,0 +1,5 @@ +[a.b.c] +answer = 42 + +[a] +better = 43 diff --git a/tests/data/valid/burntsushi/valid/implicit-and-explicit-before.json b/tests/data/valid/burntsushi/valid/implicit-and-explicit-before.json new file mode 100644 index 0000000..663a34e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/implicit-and-explicit-before.json @@ -0,0 +1,16 @@ +{ + "a": { + "b": { + "c": { + "answer": { + "type": "integer", + "value": "42" + } + } + }, + "better": { + "type": "integer", + "value": "43" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/implicit-and-explicit-before.toml b/tests/data/valid/burntsushi/valid/implicit-and-explicit-before.toml new file mode 100644 index 0000000..eee68ff --- /dev/null +++ b/tests/data/valid/burntsushi/valid/implicit-and-explicit-before.toml @@ -0,0 +1,5 @@ +[a] +better = 43 + +[a.b.c] +answer = 42 diff --git a/tests/data/valid/burntsushi/valid/implicit-groups.json b/tests/data/valid/burntsushi/valid/implicit-groups.json new file mode 100644 index 0000000..347c693 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/implicit-groups.json @@ -0,0 +1,12 @@ +{ + "a": { + "b": { + "c": { + "answer": { + "type": "integer", + "value": "42" + } + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/implicit-groups.toml b/tests/data/valid/burntsushi/valid/implicit-groups.toml new file mode 100644 index 0000000..b6333e4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/implicit-groups.toml @@ -0,0 +1,2 @@ +[a.b.c] +answer = 42 diff --git a/tests/data/valid/burntsushi/valid/inline-table/array.json b/tests/data/valid/burntsushi/valid/inline-table/array.json new file mode 100644 index 0000000..fe78bf6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/array.json @@ -0,0 +1,34 @@ +{ + "people": [ + { + "first_name": { + "type": "string", + "value": "Bruce" + }, + "last_name": { + "type": "string", + "value": "Springsteen" + } + }, + { + "first_name": { + "type": "string", + "value": "Eric" + }, + "last_name": { + "type": "string", + "value": "Clapton" + } + }, + { + "first_name": { + "type": "string", + "value": "Bob" + }, + "last_name": { + "type": "string", + "value": "Seger" + } + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/array.toml b/tests/data/valid/burntsushi/valid/inline-table/array.toml new file mode 100644 index 0000000..3fa60d6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/array.toml @@ -0,0 +1,3 @@ +people = [{first_name = "Bruce", last_name = "Springsteen"}, + {first_name = "Eric", last_name = "Clapton"}, + {first_name = "Bob", last_name = "Seger"}] diff --git a/tests/data/valid/burntsushi/valid/inline-table/bool.json b/tests/data/valid/burntsushi/valid/inline-table/bool.json new file mode 100644 index 0000000..717952f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/bool.json @@ -0,0 +1,12 @@ +{ + "a": { + "a": { + "type": "bool", + "value": "true" + }, + "b": { + "type": "bool", + "value": "false" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/bool.toml b/tests/data/valid/burntsushi/valid/inline-table/bool.toml new file mode 100644 index 0000000..d228fc2 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/bool.toml @@ -0,0 +1 @@ +a = {a = true, b = false} diff --git a/tests/data/valid/burntsushi/valid/inline-table/empty.json b/tests/data/valid/burntsushi/valid/inline-table/empty.json new file mode 100644 index 0000000..28beacf --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/empty.json @@ -0,0 +1,30 @@ +{ + "empty1": {}, + "empty2": {}, + "empty_in_array": [ + { + "not_empty": { + "type": "integer", + "value": "1" + } + }, + {} + ], + "empty_in_array2": [ + {}, + { + "not_empty": { + "type": "integer", + "value": "1" + } + } + ], + "many_empty": [ + {}, + {}, + {} + ], + "nested_empty": { + "empty": {} + } +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/empty.toml b/tests/data/valid/burntsushi/valid/inline-table/empty.toml new file mode 100644 index 0000000..910d458 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/empty.toml @@ -0,0 +1,6 @@ +empty1 = {} +empty2 = { } +empty_in_array = [ { not_empty = 1 }, {} ] +empty_in_array2 = [{},{not_empty=1}] +many_empty = [{},{},{}] +nested_empty = {"empty"={}} diff --git a/tests/data/valid/burntsushi/valid/inline-table/end-in-bool.json b/tests/data/valid/burntsushi/valid/inline-table/end-in-bool.json new file mode 100644 index 0000000..90e700a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/end-in-bool.json @@ -0,0 +1,16 @@ +{ + "black": { + "allow_prereleases": { + "type": "bool", + "value": "true" + }, + "python": { + "type": "string", + "value": "\u003e3.6" + }, + "version": { + "type": "string", + "value": "\u003e=18.9b0" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/end-in-bool.toml b/tests/data/valid/burntsushi/valid/inline-table/end-in-bool.toml new file mode 100644 index 0000000..94e5651 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/end-in-bool.toml @@ -0,0 +1 @@ +black = { python=">3.6", version=">=18.9b0", allow_prereleases=true } diff --git a/tests/data/valid/burntsushi/valid/inline-table/inline-table.json b/tests/data/valid/burntsushi/valid/inline-table/inline-table.json new file mode 100644 index 0000000..2468f62 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/inline-table.json @@ -0,0 +1,48 @@ +{ + "name": { + "first": { + "type": "string", + "value": "Tom" + }, + "last": { + "type": "string", + "value": "Preston-Werner" + } + }, + "point": { + "x": { + "type": "integer", + "value": "1" + }, + "y": { + "type": "integer", + "value": "2" + } + }, + "simple": { + "a": { + "type": "integer", + "value": "1" + } + }, + "str-key": { + "a": { + "type": "integer", + "value": "1" + } + }, + "table-array": [ + { + "a": { + "type": "integer", + "value": "1" + } + }, + { + "b": { + "type": "integer", + "value": "2" + } + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/inline-table.toml b/tests/data/valid/burntsushi/valid/inline-table/inline-table.toml new file mode 100644 index 0000000..257047e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/inline-table.toml @@ -0,0 +1,5 @@ +name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 } +simple = { a = 1 } +str-key = { "a" = 1 } +table-array = [{ "a" = 1 }, { "b" = 2 }] diff --git a/tests/data/valid/burntsushi/valid/inline-table/key-dotted.json b/tests/data/valid/burntsushi/valid/inline-table/key-dotted.json new file mode 100644 index 0000000..3886803 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/key-dotted.json @@ -0,0 +1,140 @@ +{ + "a": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + }, + "arr": [ + { + "T": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + }, + "t": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + } + }, + { + "T": { + "a": { + "b": { + "type": "integer", + "value": "2" + } + } + }, + "t": { + "a": { + "b": { + "type": "integer", + "value": "2" + } + } + } + } + ], + "b": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + }, + "c": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + }, + "d": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + }, + "e": { + "a": { + "b": { + "type": "integer", + "value": "1" + } + } + }, + "inline": { + "a": { + "b": { + "type": "integer", + "value": "42" + } + } + }, + "many": { + "dots": { + "here": { + "dot": { + "dot": { + "dot": { + "a": { + "b": { + "c": { + "type": "integer", + "value": "1" + }, + "d": { + "type": "integer", + "value": "2" + } + } + } + } + } + } + } + } + }, + "tbl": { + "a": { + "b": { + "c": { + "d": { + "e": { + "type": "integer", + "value": "1" + } + } + } + } + }, + "x": { + "a": { + "b": { + "c": { + "d": { + "e": { + "type": "integer", + "value": "1" + } + } + } + } + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/key-dotted.toml b/tests/data/valid/burntsushi/valid/inline-table/key-dotted.toml new file mode 100644 index 0000000..e812943 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/key-dotted.toml @@ -0,0 +1,23 @@ +inline = {a.b = 42} + +many.dots.here.dot.dot.dot = {a.b.c = 1, a.b.d = 2} + +a = { a.b = 1 } +b = { "a"."b" = 1 } +c = { a . b = 1 } +d = { 'a' . "b" = 1 } +e = {a.b=1} + +[tbl] +a.b.c = {d.e=1} + +[tbl.x] +a.b.c = {d.e=1} + +[[arr]] +t = {a.b=1} +T = {a.b=1} + +[[arr]] +t = {a.b=2} +T = {a.b=2} diff --git a/tests/data/valid/burntsushi/valid/inline-table/multiline.json b/tests/data/valid/burntsushi/valid/inline-table/multiline.json new file mode 100644 index 0000000..f946d81 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/multiline.json @@ -0,0 +1,20 @@ +{ + "tbl_multiline": { + "a": { + "type": "integer", + "value": "1" + }, + "b": { + "type": "string", + "value": "multiline\n" + }, + "c": { + "type": "string", + "value": "and yet\nanother line" + }, + "d": { + "type": "integer", + "value": "4" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/multiline.toml b/tests/data/valid/burntsushi/valid/inline-table/multiline.toml new file mode 100644 index 0000000..a653b18 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/multiline.toml @@ -0,0 +1,4 @@ +tbl_multiline = { a = 1, b = """ +multiline +""", c = """and yet +another line""", d = 4 } diff --git a/tests/data/valid/burntsushi/valid/inline-table/nest.json b/tests/data/valid/burntsushi/valid/inline-table/nest.json new file mode 100644 index 0000000..70aebb3 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/nest.json @@ -0,0 +1,64 @@ +{ + "arr_arr_tbl_empty": [ + [ + {} + ] + ], + "arr_arr_tbl_val": [ + [ + { + "one": { + "type": "integer", + "value": "1" + } + } + ] + ], + "arr_arr_tbls": [ + [ + { + "one": { + "type": "integer", + "value": "1" + } + }, + { + "two": { + "type": "integer", + "value": "2" + } + } + ] + ], + "arr_tbl_tbl": [ + { + "tbl": { + "one": { + "type": "integer", + "value": "1" + } + } + } + ], + "tbl_arr_tbl": { + "arr_tbl": [ + { + "one": { + "type": "integer", + "value": "1" + } + } + ] + }, + "tbl_tbl_empty": { + "tbl_0": {} + }, + "tbl_tbl_val": { + "tbl_1": { + "one": { + "type": "integer", + "value": "1" + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/inline-table/nest.toml b/tests/data/valid/burntsushi/valid/inline-table/nest.toml new file mode 100644 index 0000000..2624c1d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/inline-table/nest.toml @@ -0,0 +1,10 @@ +tbl_tbl_empty = { tbl_0 = {} } +tbl_tbl_val = { tbl_1 = { one = 1 } } +tbl_arr_tbl = { arr_tbl = [ { one = 1 } ] } +arr_tbl_tbl = [ { tbl = { one = 1 } } ] + +# Array-of-array-of-table is interesting because it can only +# be represented in inline form. +arr_arr_tbl_empty = [ [ {} ] ] +arr_arr_tbl_val = [ [ { one = 1 } ] ] +arr_arr_tbls = [ [ { one = 1 }, { two = 2 } ] ] diff --git a/tests/data/valid/burntsushi/valid/integer/integer.json b/tests/data/valid/burntsushi/valid/integer/integer.json new file mode 100644 index 0000000..eee9758 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/integer.json @@ -0,0 +1,18 @@ +{ + "answer": { + "type": "integer", + "value": "42" + }, + "neganswer": { + "type": "integer", + "value": "-42" + }, + "posanswer": { + "type": "integer", + "value": "42" + }, + "zero": { + "type": "integer", + "value": "0" + } +} diff --git a/tests/data/valid/burntsushi/valid/integer/integer.toml b/tests/data/valid/burntsushi/valid/integer/integer.toml new file mode 100644 index 0000000..b62de30 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/integer.toml @@ -0,0 +1,4 @@ +answer = 42 +posanswer = +42 +neganswer = -42 +zero = 0 diff --git a/tests/data/valid/burntsushi/valid/integer/literals.json b/tests/data/valid/burntsushi/valid/integer/literals.json new file mode 100644 index 0000000..1a8555b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/literals.json @@ -0,0 +1,38 @@ +{ + "bin1": { + "type": "integer", + "value": "214" + }, + "bin2": { + "type": "integer", + "value": "5" + }, + "hex1": { + "type": "integer", + "value": "3735928559" + }, + "hex2": { + "type": "integer", + "value": "3735928559" + }, + "hex3": { + "type": "integer", + "value": "3735928559" + }, + "hex4": { + "type": "integer", + "value": "2439" + }, + "oct1": { + "type": "integer", + "value": "342391" + }, + "oct2": { + "type": "integer", + "value": "493" + }, + "oct3": { + "type": "integer", + "value": "501" + } +} diff --git a/tests/data/valid/burntsushi/valid/integer/literals.toml b/tests/data/valid/burntsushi/valid/integer/literals.toml new file mode 100644 index 0000000..a078590 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/literals.toml @@ -0,0 +1,11 @@ +bin1 = 0b11010110 +bin2 = 0b1_0_1 + +oct1 = 0o01234567 +oct2 = 0o755 +oct3 = 0o7_6_5 + +hex1 = 0xDEADBEEF +hex2 = 0xdeadbeef +hex3 = 0xdead_beef +hex4 = 0x00987 diff --git a/tests/data/valid/burntsushi/valid/integer/long.json b/tests/data/valid/burntsushi/valid/integer/long.json new file mode 100644 index 0000000..6f4f0a7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/long.json @@ -0,0 +1,10 @@ +{ + "int64-max": { + "type": "integer", + "value": "9223372036854775807" + }, + "int64-max-neg": { + "type": "integer", + "value": "-9223372036854775808" + } +} diff --git a/tests/data/valid/burntsushi/valid/integer/long.toml b/tests/data/valid/burntsushi/valid/integer/long.toml new file mode 100644 index 0000000..5db5ed7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/long.toml @@ -0,0 +1,2 @@ +int64-max = 9223372036854775807 +int64-max-neg = -9223372036854775808 diff --git a/tests/data/valid/burntsushi/valid/integer/underscore.json b/tests/data/valid/burntsushi/valid/integer/underscore.json new file mode 100644 index 0000000..10b9b59 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/underscore.json @@ -0,0 +1,10 @@ +{ + "kilo": { + "type": "integer", + "value": "1000" + }, + "x": { + "type": "integer", + "value": "1111" + } +} diff --git a/tests/data/valid/burntsushi/valid/integer/underscore.toml b/tests/data/valid/burntsushi/valid/integer/underscore.toml new file mode 100644 index 0000000..7c2da5f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/underscore.toml @@ -0,0 +1,2 @@ +kilo = 1_000 +x = 1_1_1_1 diff --git a/tests/data/valid/burntsushi/valid/integer/zero.json b/tests/data/valid/burntsushi/valid/integer/zero.json new file mode 100644 index 0000000..9d5c707 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/zero.json @@ -0,0 +1,50 @@ +{ + "a2": { + "type": "integer", + "value": "0" + }, + "a3": { + "type": "integer", + "value": "0" + }, + "b1": { + "type": "integer", + "value": "0" + }, + "b2": { + "type": "integer", + "value": "0" + }, + "b3": { + "type": "integer", + "value": "0" + }, + "d1": { + "type": "integer", + "value": "0" + }, + "d2": { + "type": "integer", + "value": "0" + }, + "d3": { + "type": "integer", + "value": "0" + }, + "h1": { + "type": "integer", + "value": "0" + }, + "h2": { + "type": "integer", + "value": "0" + }, + "h3": { + "type": "integer", + "value": "0" + }, + "o1": { + "type": "integer", + "value": "0" + } +} diff --git a/tests/data/valid/burntsushi/valid/integer/zero.toml b/tests/data/valid/burntsushi/valid/integer/zero.toml new file mode 100644 index 0000000..4687c28 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/integer/zero.toml @@ -0,0 +1,15 @@ +d1 = 0 +d2 = +0 +d3 = -0 + +h1 = 0x0 +h2 = 0x00 +h3 = 0x00000 + +o1 = 0o0 +a2 = 0o00 +a3 = 0o00000 + +b1 = 0b0 +b2 = 0b00 +b3 = 0b00000 diff --git a/tests/data/valid/burntsushi/valid/key/alphanum.json b/tests/data/valid/burntsushi/valid/key/alphanum.json new file mode 100644 index 0000000..a54e1d3 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/alphanum.json @@ -0,0 +1,46 @@ +{ + "000111": { + "type": "string", + "value": "leading" + }, + "10e3": { + "type": "string", + "value": "false float" + }, + "123": { + "type": "string", + "value": "num" + }, + "2018_10": { + "001": { + "type": "integer", + "value": "1" + } + }, + "34-11": { + "type": "integer", + "value": "23" + }, + "a-a-a": { + "_": { + "type": "bool", + "value": "false" + } + }, + "alpha": { + "type": "string", + "value": "a" + }, + "one1two2": { + "type": "string", + "value": "mixed" + }, + "under_score": { + "type": "string", + "value": "___" + }, + "with-dash": { + "type": "string", + "value": "dashed" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/alphanum.toml b/tests/data/valid/burntsushi/valid/key/alphanum.toml new file mode 100644 index 0000000..0632e9c --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/alphanum.toml @@ -0,0 +1,14 @@ +alpha = "a" +123 = "num" +000111 = "leading" +10e3 = "false float" +one1two2 = "mixed" +with-dash = "dashed" +under_score = "___" +34-11 = 23 + +[2018_10] +001 = 1 + +[a-a-a] +_ = false diff --git a/tests/data/valid/burntsushi/valid/key/case-sensitive.json b/tests/data/valid/burntsushi/valid/key/case-sensitive.json new file mode 100644 index 0000000..1f205d2 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/case-sensitive.json @@ -0,0 +1,38 @@ +{ + "Section": { + "M": { + "type": "string", + "value": "latin letter M" + }, + "name": { + "type": "string", + "value": "different section!!" + }, + "Μ": { + "type": "string", + "value": "greek capital letter MU" + }, + "μ": { + "type": "string", + "value": "greek small letter mu" + } + }, + "sectioN": { + "type": "string", + "value": "NN" + }, + "section": { + "NAME": { + "type": "string", + "value": "upper" + }, + "Name": { + "type": "string", + "value": "capitalized" + }, + "name": { + "type": "string", + "value": "lower" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/key/case-sensitive.toml b/tests/data/valid/burntsushi/valid/key/case-sensitive.toml new file mode 100644 index 0000000..e02b3a5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/case-sensitive.toml @@ -0,0 +1,13 @@ +sectioN = "NN" + +[section] +name = "lower" +NAME = "upper" +Name = "capitalized" + +[Section] +name = "different section!!" +"μ" = "greek small letter mu" +"Μ" = "greek capital letter MU" +M = "latin letter M" + diff --git a/tests/data/valid/burntsushi/valid/key/dotted.json b/tests/data/valid/burntsushi/valid/key/dotted.json new file mode 100644 index 0000000..a527a72 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/dotted.json @@ -0,0 +1,132 @@ +{ + "a": { + "few": { + "dots": { + "polka": { + "dance-with": { + "type": "string", + "value": "Dot" + }, + "dot": { + "type": "string", + "value": "again?" + } + } + } + } + }, + "arr": [ + { + "a": { + "b": { + "c": { + "type": "integer", + "value": "1" + }, + "d": { + "type": "integer", + "value": "2" + } + } + } + }, + { + "a": { + "b": { + "c": { + "type": "integer", + "value": "3" + }, + "d": { + "type": "integer", + "value": "4" + } + } + } + } + ], + "count": { + "a": { + "type": "integer", + "value": "1" + }, + "b": { + "type": "integer", + "value": "2" + }, + "c": { + "type": "integer", + "value": "3" + }, + "d": { + "type": "integer", + "value": "4" + }, + "e": { + "type": "integer", + "value": "5" + }, + "f": { + "type": "integer", + "value": "6" + }, + "g": { + "type": "integer", + "value": "7" + }, + "h": { + "type": "integer", + "value": "8" + }, + "i": { + "type": "integer", + "value": "9" + }, + "j": { + "type": "integer", + "value": "10" + }, + "k": { + "type": "integer", + "value": "11" + }, + "l": { + "type": "integer", + "value": "12" + } + }, + "many": { + "dots": { + "here": { + "dot": { + "dot": { + "dot": { + "type": "integer", + "value": "42" + } + } + } + } + } + }, + "name": { + "first": { + "type": "string", + "value": "Arthur" + }, + "last": { + "type": "string", + "value": "Dent" + } + }, + "tbl": { + "a": { + "b": { + "c": { + "type": "float", + "value": "42.666" + } + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/key/dotted.toml b/tests/data/valid/burntsushi/valid/key/dotted.toml new file mode 100644 index 0000000..52d62d7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/dotted.toml @@ -0,0 +1,35 @@ +# Note: this file contains literal tab characters. + +name.first = "Arthur" +"name".'last' = "Dent" + +many.dots.here.dot.dot.dot = 42 + +# Space are ignored, and key parts can be quoted. +count.a = 1 +count . b = 2 +"count"."c" = 3 +"count" . "d" = 4 +'count'.'e' = 5 +'count' . 'f' = 6 +"count".'g' = 7 +"count" . 'h' = 8 +count.'i' = 9 +count . 'j' = 10 +"count".k = 11 +"count" . l = 12 + +[tbl] +a.b.c = 42.666 + +[a.few.dots] +polka.dot = "again?" +polka.dance-with = "Dot" + +[[arr]] +a.b.c=1 +a.b.d=2 + +[[arr]] +a.b.c=3 +a.b.d=4 diff --git a/tests/data/valid/burntsushi/valid/key/empty.json b/tests/data/valid/burntsushi/valid/key/empty.json new file mode 100644 index 0000000..44948a9 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/empty.json @@ -0,0 +1,6 @@ +{ + "": { + "type": "string", + "value": "blank" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/empty.toml b/tests/data/valid/burntsushi/valid/key/empty.toml new file mode 100644 index 0000000..0a1640d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/empty.toml @@ -0,0 +1 @@ +"" = "blank" diff --git a/tests/data/valid/burntsushi/valid/key/equals-nospace.json b/tests/data/valid/burntsushi/valid/key/equals-nospace.json new file mode 100644 index 0000000..9394e56 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/equals-nospace.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "integer", + "value": "42" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/equals-nospace.toml b/tests/data/valid/burntsushi/valid/key/equals-nospace.toml new file mode 100644 index 0000000..560901c --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/equals-nospace.toml @@ -0,0 +1 @@ +answer=42 diff --git a/tests/data/valid/burntsushi/valid/key/escapes.json b/tests/data/valid/burntsushi/valid/key/escapes.json new file mode 100644 index 0000000..e62b3a1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/escapes.json @@ -0,0 +1,24 @@ +{ + "\n": { + "type": "string", + "value": "newline" + }, + "\"": { + "type": "string", + "value": "just a quote" + }, + "\"quoted\"": { + "quote": { + "type": "bool", + "value": "true" + } + }, + "a.b": { + "À": {} + }, + "backsp\u0008\u0008": {}, + "À": { + "type": "string", + "value": "latin capital letter A with grave" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/escapes.toml b/tests/data/valid/burntsushi/valid/key/escapes.toml new file mode 100644 index 0000000..aac3c0a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/escapes.toml @@ -0,0 +1,10 @@ +"\n" = "newline" +"\u00c0" = "latin capital letter A with grave" +"\"" = "just a quote" + +["backsp\b\b"] + +["\"quoted\""] +quote = true + +["a.b"."\u00c0"] diff --git a/tests/data/valid/burntsushi/valid/key/numeric-dotted.json b/tests/data/valid/burntsushi/valid/key/numeric-dotted.json new file mode 100644 index 0000000..43dd4d1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/numeric-dotted.json @@ -0,0 +1,8 @@ +{ + "1": { + "2": { + "type": "integer", + "value": "3" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/key/numeric-dotted.toml b/tests/data/valid/burntsushi/valid/key/numeric-dotted.toml new file mode 100644 index 0000000..538204c --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/numeric-dotted.toml @@ -0,0 +1 @@ +1.2 = 3 diff --git a/tests/data/valid/burntsushi/valid/key/numeric.json b/tests/data/valid/burntsushi/valid/key/numeric.json new file mode 100644 index 0000000..eddb88b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/numeric.json @@ -0,0 +1,6 @@ +{ + "1": { + "type": "integer", + "value": "1" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/numeric.toml b/tests/data/valid/burntsushi/valid/key/numeric.toml new file mode 100644 index 0000000..532356f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/numeric.toml @@ -0,0 +1 @@ +1 = 1 diff --git a/tests/data/valid/burntsushi/valid/key/quoted-dots.json b/tests/data/valid/burntsushi/valid/key/quoted-dots.json new file mode 100644 index 0000000..1582c5b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/quoted-dots.json @@ -0,0 +1,32 @@ +{ + "plain": { + "type": "integer", + "value": "1" + }, + "plain_table": { + "plain": { + "type": "integer", + "value": "3" + }, + "with.dot": { + "type": "integer", + "value": "4" + } + }, + "table": { + "withdot": { + "key.with.dots": { + "type": "integer", + "value": "6" + }, + "plain": { + "type": "integer", + "value": "5" + } + } + }, + "with.dot": { + "type": "integer", + "value": "2" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/quoted-dots.toml b/tests/data/valid/burntsushi/valid/key/quoted-dots.toml new file mode 100644 index 0000000..65fcddf --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/quoted-dots.toml @@ -0,0 +1,10 @@ +plain = 1 +"with.dot" = 2 + +[plain_table] +plain = 3 +"with.dot" = 4 + +[table.withdot] +plain = 5 +"key.with.dots" = 6 diff --git a/tests/data/valid/burntsushi/valid/key/space.json b/tests/data/valid/burntsushi/valid/key/space.json new file mode 100644 index 0000000..6d95f1a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/space.json @@ -0,0 +1,6 @@ +{ + "a b": { + "type": "integer", + "value": "1" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/space.toml b/tests/data/valid/burntsushi/valid/key/space.toml new file mode 100644 index 0000000..f4f36c4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/space.toml @@ -0,0 +1 @@ +"a b" = 1 diff --git a/tests/data/valid/burntsushi/valid/key/special-chars.json b/tests/data/valid/burntsushi/valid/key/special-chars.json new file mode 100644 index 0000000..6084047 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/special-chars.json @@ -0,0 +1,6 @@ +{ + "~!@$^\u0026*()_+-`1234567890[]|/?\u003e\u003c.,;:'": { + "type": "integer", + "value": "1" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/special-chars.toml b/tests/data/valid/burntsushi/valid/key/special-chars.toml new file mode 100644 index 0000000..cc572be --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/special-chars.toml @@ -0,0 +1 @@ +"~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1 diff --git a/tests/data/valid/burntsushi/valid/key/special-word.json b/tests/data/valid/burntsushi/valid/key/special-word.json new file mode 100644 index 0000000..59ce693 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/special-word.json @@ -0,0 +1,18 @@ +{ + "false": { + "type": "bool", + "value": "false" + }, + "inf": { + "type": "integer", + "value": "100000000" + }, + "nan": { + "type": "string", + "value": "ceci n'est pas un nombre" + }, + "true": { + "type": "integer", + "value": "1" + } +} diff --git a/tests/data/valid/burntsushi/valid/key/special-word.toml b/tests/data/valid/burntsushi/valid/key/special-word.toml new file mode 100644 index 0000000..0b836f1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/key/special-word.toml @@ -0,0 +1,5 @@ +false = false +true = 1 +inf = 100000000 +nan = "ceci n'est pas un nombre" + diff --git a/tests/data/valid/burntsushi/valid/newline-crlf.json b/tests/data/valid/burntsushi/valid/newline-crlf.json new file mode 100644 index 0000000..acf617e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/newline-crlf.json @@ -0,0 +1,10 @@ +{ + "newline": { + "type": "string", + "value": "crlf" + }, + "os": { + "type": "string", + "value": "DOS" + } +} diff --git a/tests/data/valid/burntsushi/valid/newline-crlf.toml b/tests/data/valid/burntsushi/valid/newline-crlf.toml new file mode 100644 index 0000000..0030024 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/newline-crlf.toml @@ -0,0 +1,2 @@ +os = "DOS"
+newline = "crlf"
diff --git a/tests/data/valid/burntsushi/valid/newline-lf.json b/tests/data/valid/burntsushi/valid/newline-lf.json new file mode 100644 index 0000000..66cf871 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/newline-lf.json @@ -0,0 +1,10 @@ +{ + "newline": { + "type": "string", + "value": "lf" + }, + "os": { + "type": "string", + "value": "unix" + } +} diff --git a/tests/data/valid/burntsushi/valid/newline-lf.toml b/tests/data/valid/burntsushi/valid/newline-lf.toml new file mode 100644 index 0000000..0f3377c --- /dev/null +++ b/tests/data/valid/burntsushi/valid/newline-lf.toml @@ -0,0 +1,2 @@ +os = "unix" +newline = "lf" diff --git a/tests/data/valid/burntsushi/valid/spec-example-1-compact.json b/tests/data/valid/burntsushi/valid/spec-example-1-compact.json new file mode 100644 index 0000000..9f4078a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/spec-example-1-compact.json @@ -0,0 +1,100 @@ +{ + "clients": { + "data": [ + [ + { + "type": "string", + "value": "gamma" + }, + { + "type": "string", + "value": "delta" + } + ], + [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + } + ] + ], + "hosts": [ + { + "type": "string", + "value": "alpha" + }, + { + "type": "string", + "value": "omega" + } + ] + }, + "database": { + "connection_max": { + "type": "integer", + "value": "5000" + }, + "enabled": { + "type": "bool", + "value": "true" + }, + "ports": [ + { + "type": "integer", + "value": "8001" + }, + { + "type": "integer", + "value": "8001" + }, + { + "type": "integer", + "value": "8002" + } + ], + "server": { + "type": "string", + "value": "192.168.1.1" + } + }, + "owner": { + "dob": { + "type": "datetime", + "value": "1979-05-27T07:32:00-08:00" + }, + "name": { + "type": "string", + "value": "Lance Uppercut" + } + }, + "servers": { + "alpha": { + "dc": { + "type": "string", + "value": "eqdc10" + }, + "ip": { + "type": "string", + "value": "10.0.0.1" + } + }, + "beta": { + "dc": { + "type": "string", + "value": "eqdc10" + }, + "ip": { + "type": "string", + "value": "10.0.0.2" + } + } + }, + "title": { + "type": "string", + "value": "TOML Example" + } +} diff --git a/tests/data/valid/burntsushi/valid/spec-example-1-compact.toml b/tests/data/valid/burntsushi/valid/spec-example-1-compact.toml new file mode 100644 index 0000000..15e2b84 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/spec-example-1-compact.toml @@ -0,0 +1,23 @@ +#Useless spaces eliminated. +title="TOML Example" +[owner] +name="Lance Uppercut" +dob=1979-05-27T07:32:00-08:00#First class dates +[database] +server="192.168.1.1" +ports=[8001,8001,8002] +connection_max=5000 +enabled=true +[servers] +[servers.alpha] +ip="10.0.0.1" +dc="eqdc10" +[servers.beta] +ip="10.0.0.2" +dc="eqdc10" +[clients] +data=[["gamma","delta"],[1,2]] +hosts=[ +"alpha", +"omega" +] diff --git a/tests/data/valid/burntsushi/valid/spec-example-1.json b/tests/data/valid/burntsushi/valid/spec-example-1.json new file mode 100644 index 0000000..9f4078a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/spec-example-1.json @@ -0,0 +1,100 @@ +{ + "clients": { + "data": [ + [ + { + "type": "string", + "value": "gamma" + }, + { + "type": "string", + "value": "delta" + } + ], + [ + { + "type": "integer", + "value": "1" + }, + { + "type": "integer", + "value": "2" + } + ] + ], + "hosts": [ + { + "type": "string", + "value": "alpha" + }, + { + "type": "string", + "value": "omega" + } + ] + }, + "database": { + "connection_max": { + "type": "integer", + "value": "5000" + }, + "enabled": { + "type": "bool", + "value": "true" + }, + "ports": [ + { + "type": "integer", + "value": "8001" + }, + { + "type": "integer", + "value": "8001" + }, + { + "type": "integer", + "value": "8002" + } + ], + "server": { + "type": "string", + "value": "192.168.1.1" + } + }, + "owner": { + "dob": { + "type": "datetime", + "value": "1979-05-27T07:32:00-08:00" + }, + "name": { + "type": "string", + "value": "Lance Uppercut" + } + }, + "servers": { + "alpha": { + "dc": { + "type": "string", + "value": "eqdc10" + }, + "ip": { + "type": "string", + "value": "10.0.0.1" + } + }, + "beta": { + "dc": { + "type": "string", + "value": "eqdc10" + }, + "ip": { + "type": "string", + "value": "10.0.0.2" + } + } + }, + "title": { + "type": "string", + "value": "TOML Example" + } +} diff --git a/tests/data/valid/burntsushi/valid/spec-example-1.toml b/tests/data/valid/burntsushi/valid/spec-example-1.toml new file mode 100644 index 0000000..52fd1e8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/spec-example-1.toml @@ -0,0 +1,33 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Lance Uppercut" +dob = 1979-05-27T07:32:00-08:00 # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] + +# Line breaks are OK when inside arrays +hosts = [ + "alpha", + "omega" +] diff --git a/tests/data/valid/burntsushi/valid/string/double-quote-escape.json b/tests/data/valid/burntsushi/valid/string/double-quote-escape.json new file mode 100644 index 0000000..0c4ac37 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/double-quote-escape.json @@ -0,0 +1,6 @@ +{ + "test": { + "type": "string", + "value": "\"one\"" + } +} diff --git a/tests/data/valid/burntsushi/valid/string/double-quote-escape.toml b/tests/data/valid/burntsushi/valid/string/double-quote-escape.toml new file mode 100644 index 0000000..78e7e72 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/double-quote-escape.toml @@ -0,0 +1 @@ +test = "\"one\"" diff --git a/tests/data/valid/burntsushi/valid/string/empty.json b/tests/data/valid/burntsushi/valid/string/empty.json new file mode 100644 index 0000000..efe96c3 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/empty.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "" + } +} diff --git a/tests/data/valid/burntsushi/valid/string/empty.toml b/tests/data/valid/burntsushi/valid/string/empty.toml new file mode 100644 index 0000000..e37e681 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/empty.toml @@ -0,0 +1 @@ +answer = "" diff --git a/tests/data/valid/burntsushi/valid/string/escape-tricky.json b/tests/data/valid/burntsushi/valid/string/escape-tricky.json new file mode 100644 index 0000000..572e0a5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/escape-tricky.json @@ -0,0 +1,30 @@ +{ + "end_esc": { + "type": "string", + "value": "String does not end here\" but ends here\\" + }, + "lit_end_esc": { + "type": "string", + "value": "String ends here\\" + }, + "lit_multiline_end": { + "type": "string", + "value": "There is no escape\\" + }, + "lit_multiline_not_unicode": { + "type": "string", + "value": "\\u007f" + }, + "multiline_end_esc": { + "type": "string", + "value": "When will it end? \"\"\"...\"\"\" should be here\"" + }, + "multiline_not_unicode": { + "type": "string", + "value": "\\u0041" + }, + "multiline_unicode": { + "type": "string", + "value": " " + } +} diff --git a/tests/data/valid/burntsushi/valid/string/escape-tricky.toml b/tests/data/valid/burntsushi/valid/string/escape-tricky.toml new file mode 100644 index 0000000..dc204cb --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/escape-tricky.toml @@ -0,0 +1,15 @@ +end_esc = "String does not end here\" but ends here\\" +lit_end_esc = 'String ends here\' + +multiline_unicode = """ +\u00a0""" + +multiline_not_unicode = """ +\\u0041""" + +multiline_end_esc = """When will it end? \"""...""\" should be here\"""" + +lit_multiline_not_unicode = ''' +\u007f''' + +lit_multiline_end = '''There is no escape\''' diff --git a/tests/data/valid/burntsushi/valid/string/escaped-escape.json b/tests/data/valid/burntsushi/valid/string/escaped-escape.json new file mode 100644 index 0000000..112c0c9 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/escaped-escape.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "\\x64" + } +} diff --git a/tests/data/valid/burntsushi/valid/string/escaped-escape.toml b/tests/data/valid/burntsushi/valid/string/escaped-escape.toml new file mode 100644 index 0000000..d575876 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/escaped-escape.toml @@ -0,0 +1 @@ +answer = "\\x64" diff --git a/tests/data/valid/burntsushi/valid/string/escapes.json b/tests/data/valid/burntsushi/valid/string/escapes.json new file mode 100644 index 0000000..d849574 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/escapes.json @@ -0,0 +1,54 @@ +{ + "backslash": { + "type": "string", + "value": "This string has a \\ backslash character." + }, + "backspace": { + "type": "string", + "value": "This string has a \u0008 backspace character." + }, + "carriage": { + "type": "string", + "value": "This string has a \r carriage return character." + }, + "delete": { + "type": "string", + "value": "This string has a delete control code." + }, + "formfeed": { + "type": "string", + "value": "This string has a \u000c form feed character." + }, + "newline": { + "type": "string", + "value": "This string has a \n new line 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 \\u 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 \\u escape." + }, + "quote": { + "type": "string", + "value": "This string has a \" quote character." + }, + "tab": { + "type": "string", + "value": "This string has a \t tab character." + }, + "unitseparator": { + "type": "string", + "value": "This string has a \u001f unit separator control code." + } +} diff --git a/tests/data/valid/burntsushi/valid/string/escapes.toml b/tests/data/valid/burntsushi/valid/string/escapes.toml new file mode 100644 index 0000000..78f7ebd --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/escapes.toml @@ -0,0 +1,13 @@ +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." +quote = "This string has a \" quote 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." +delete = "This string has a \u007F delete control code." +unitseparator = "This string has a \u001F unit separator control code." diff --git a/tests/data/valid/burntsushi/valid/string/multiline-quotes.json b/tests/data/valid/burntsushi/valid/string/multiline-quotes.json new file mode 100644 index 0000000..c134f67 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/multiline-quotes.json @@ -0,0 +1,42 @@ +{ + "lit_one": { + "type": "string", + "value": "'one quote'" + }, + "lit_one_space": { + "type": "string", + "value": " 'one quote' " + }, + "lit_two": { + "type": "string", + "value": "''two quotes''" + }, + "lit_two_space": { + "type": "string", + "value": " ''two quotes'' " + }, + "mismatch1": { + "type": "string", + "value": "aaa'''bbb" + }, + "mismatch2": { + "type": "string", + "value": "aaa\"\"\"bbb" + }, + "one": { + "type": "string", + "value": "\"one quote\"" + }, + "one_space": { + "type": "string", + "value": " \"one quote\" " + }, + "two": { + "type": "string", + "value": "\"\"two quotes\"\"" + }, + "two_space": { + "type": "string", + "value": " \"\"two quotes\"\" " + } +} diff --git a/tests/data/valid/burntsushi/valid/string/multiline-quotes.toml b/tests/data/valid/burntsushi/valid/string/multiline-quotes.toml new file mode 100644 index 0000000..e138e2f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/multiline-quotes.toml @@ -0,0 +1,15 @@ +# Make sure that quotes inside multiline strings are allowed, including right +# after the opening '''/""" and before the closing '''/""" + +lit_one = ''''one quote'''' +lit_two = '''''two quotes''''' +lit_one_space = ''' 'one quote' ''' +lit_two_space = ''' ''two quotes'' ''' + +one = """"one quote"""" +two = """""two quotes""""" +one_space = """ "one quote" """ +two_space = """ ""two quotes"" """ + +mismatch1 = """aaa'''bbb""" +mismatch2 = '''aaa"""bbb''' diff --git a/tests/data/valid/burntsushi/valid/string/multiline.json b/tests/data/valid/burntsushi/valid/string/multiline.json new file mode 100644 index 0000000..66e572b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/multiline.json @@ -0,0 +1,54 @@ +{ + "equivalent_one": { + "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." + }, + "equivalent_two": { + "type": "string", + "value": "The quick brown fox jumps over the lazy dog." + }, + "escape-bs-1": { + "type": "string", + "value": "a \\\nb" + }, + "escape-bs-2": { + "type": "string", + "value": "a \\b" + }, + "escape-bs-3": { + "type": "string", + "value": "a \\\\\n b" + }, + "keep-ws-before": { + "type": "string", + "value": "a \tb" + }, + "multiline_empty_four": { + "type": "string", + "value": "" + }, + "multiline_empty_one": { + "type": "string", + "value": "" + }, + "multiline_empty_three": { + "type": "string", + "value": "" + }, + "multiline_empty_two": { + "type": "string", + "value": "" + }, + "no-space": { + "type": "string", + "value": "ab" + }, + "whitespace-after-bs": { + "type": "string", + "value": "The quick brown fox jumps over the lazy dog." + } +} diff --git a/tests/data/valid/burntsushi/valid/string/multiline.toml b/tests/data/valid/burntsushi/valid/string/multiline.toml new file mode 100644 index 0000000..f3b3c2e --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/multiline.toml @@ -0,0 +1,52 @@ +# NOTE: this file includes some literal tab characters. + +multiline_empty_one = """""" + +# A newline immediately following the opening delimiter will be trimmed. +multiline_empty_two = """ +""" + +# \ at the end of line trims newlines as well; note that last \ is followed by +# two spaces, which are ignored. +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.\ + """ + +whitespace-after-bs = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +no-space = """a\ + b""" + +# Has tab character. +keep-ws-before = """a \ + b""" + +escape-bs-1 = """a \\ +b""" + +escape-bs-2 = """a \\\ +b""" + +escape-bs-3 = """a \\\\ + b""" diff --git a/tests/data/valid/burntsushi/valid/string/nl.json b/tests/data/valid/burntsushi/valid/string/nl.json new file mode 100644 index 0000000..8eae09a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/nl.json @@ -0,0 +1,22 @@ +{ + "lit_nl_end": { + "type": "string", + "value": "value\\n" + }, + "lit_nl_mid": { + "type": "string", + "value": "val\\nue" + }, + "lit_nl_uni": { + "type": "string", + "value": "val\\ue" + }, + "nl_end": { + "type": "string", + "value": "value\n" + }, + "nl_mid": { + "type": "string", + "value": "val\nue" + } +} diff --git a/tests/data/valid/burntsushi/valid/string/nl.toml b/tests/data/valid/burntsushi/valid/string/nl.toml new file mode 100644 index 0000000..1e09a8b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/nl.toml @@ -0,0 +1,6 @@ +nl_mid = "val\nue" +nl_end = """value\n""" + +lit_nl_end = '''value\n''' +lit_nl_mid = 'val\nue' +lit_nl_uni = 'val\ue' diff --git a/tests/data/valid/burntsushi/valid/string/raw-multiline.json b/tests/data/valid/burntsushi/valid/string/raw-multiline.json new file mode 100644 index 0000000..4d195ec --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/raw-multiline.json @@ -0,0 +1,14 @@ +{ + "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." + }, + "oneline": { + "type": "string", + "value": "This string has a ' quote character." + } +} diff --git a/tests/data/valid/burntsushi/valid/string/raw-multiline.toml b/tests/data/valid/burntsushi/valid/string/raw-multiline.toml new file mode 100644 index 0000000..293f803 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/raw-multiline.toml @@ -0,0 +1,14 @@ +# Single ' should be allowed. +oneline = '''This string has a ' quote character.''' + +# A newline immediately following the opening delimiter will be trimmed. +firstnl = ''' +This string has a ' quote character.''' + +# All other whitespace and newline characters remain intact. +multiline = ''' +This string +has ' a quote character +and more than +one newline +in it.''' diff --git a/tests/data/valid/burntsushi/valid/string/raw.json b/tests/data/valid/burntsushi/valid/string/raw.json new file mode 100644 index 0000000..6b753a3 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/raw.json @@ -0,0 +1,30 @@ +{ + "backslash": { + "type": "string", + "value": "This string has a \\\\ backslash character." + }, + "backspace": { + "type": "string", + "value": "This string has a \\b backspace character." + }, + "carriage": { + "type": "string", + "value": "This string has a \\r carriage return character." + }, + "formfeed": { + "type": "string", + "value": "This string has a \\f form feed character." + }, + "newline": { + "type": "string", + "value": "This string has a \\n new line character." + }, + "slash": { + "type": "string", + "value": "This string has a \\/ slash character." + }, + "tab": { + "type": "string", + "value": "This string has a \\t tab character." + } +} diff --git a/tests/data/valid/burntsushi/valid/string/raw.toml b/tests/data/valid/burntsushi/valid/string/raw.toml new file mode 100644 index 0000000..92acd25 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/raw.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/data/valid/burntsushi/valid/string/simple.json b/tests/data/valid/burntsushi/valid/string/simple.json new file mode 100644 index 0000000..2561cda --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/simple.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "You are not drinking enough whisky." + } +} diff --git a/tests/data/valid/burntsushi/valid/string/simple.toml b/tests/data/valid/burntsushi/valid/string/simple.toml new file mode 100644 index 0000000..e17ade6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/simple.toml @@ -0,0 +1 @@ +answer = "You are not drinking enough whisky." diff --git a/tests/data/valid/burntsushi/valid/string/unicode-escape.json b/tests/data/valid/burntsushi/valid/string/unicode-escape.json new file mode 100644 index 0000000..9ae728b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/unicode-escape.json @@ -0,0 +1,10 @@ +{ + "answer4": { + "type": "string", + "value": "δ" + }, + "answer8": { + "type": "string", + "value": "δ" + } +} diff --git a/tests/data/valid/burntsushi/valid/string/unicode-escape.toml b/tests/data/valid/burntsushi/valid/string/unicode-escape.toml new file mode 100644 index 0000000..82faecb --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/unicode-escape.toml @@ -0,0 +1,2 @@ +answer4 = "\u03B4" +answer8 = "\U000003B4" diff --git a/tests/data/valid/burntsushi/valid/string/unicode-literal.json b/tests/data/valid/burntsushi/valid/string/unicode-literal.json new file mode 100644 index 0000000..7f15df4 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/unicode-literal.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "δ" + } +} diff --git a/tests/data/valid/burntsushi/valid/string/unicode-literal.toml b/tests/data/valid/burntsushi/valid/string/unicode-literal.toml new file mode 100644 index 0000000..c65723c --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/unicode-literal.toml @@ -0,0 +1 @@ +answer = "δ" diff --git a/tests/data/valid/burntsushi/valid/string/with-pound.json b/tests/data/valid/burntsushi/valid/string/with-pound.json new file mode 100644 index 0000000..2cb8beb --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/with-pound.json @@ -0,0 +1,10 @@ +{ + "pound": { + "type": "string", + "value": "We see no # comments here." + }, + "poundcomment": { + "type": "string", + "value": "But there are # some comments here." + } +} diff --git a/tests/data/valid/burntsushi/valid/string/with-pound.toml b/tests/data/valid/burntsushi/valid/string/with-pound.toml new file mode 100644 index 0000000..5fd8746 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/string/with-pound.toml @@ -0,0 +1,2 @@ +pound = "We see no # comments here." +poundcomment = "But there are # some comments here." # Did I # mess you up? diff --git a/tests/data/valid/burntsushi/valid/table/array-implicit.json b/tests/data/valid/burntsushi/valid/table/array-implicit.json new file mode 100644 index 0000000..ee164c5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-implicit.json @@ -0,0 +1,12 @@ +{ + "albums": { + "songs": [ + { + "name": { + "type": "string", + "value": "Glory Days" + } + } + ] + } +} diff --git a/tests/data/valid/burntsushi/valid/table/array-implicit.toml b/tests/data/valid/burntsushi/valid/table/array-implicit.toml new file mode 100644 index 0000000..3157ac9 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-implicit.toml @@ -0,0 +1,2 @@ +[[albums.songs]] +name = "Glory Days" diff --git a/tests/data/valid/burntsushi/valid/table/array-many.json b/tests/data/valid/burntsushi/valid/table/array-many.json new file mode 100644 index 0000000..fe78bf6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-many.json @@ -0,0 +1,34 @@ +{ + "people": [ + { + "first_name": { + "type": "string", + "value": "Bruce" + }, + "last_name": { + "type": "string", + "value": "Springsteen" + } + }, + { + "first_name": { + "type": "string", + "value": "Eric" + }, + "last_name": { + "type": "string", + "value": "Clapton" + } + }, + { + "first_name": { + "type": "string", + "value": "Bob" + }, + "last_name": { + "type": "string", + "value": "Seger" + } + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/table/array-many.toml b/tests/data/valid/burntsushi/valid/table/array-many.toml new file mode 100644 index 0000000..46062be --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-many.toml @@ -0,0 +1,11 @@ +[[people]] +first_name = "Bruce" +last_name = "Springsteen" + +[[people]] +first_name = "Eric" +last_name = "Clapton" + +[[people]] +first_name = "Bob" +last_name = "Seger" diff --git a/tests/data/valid/burntsushi/valid/table/array-nest.json b/tests/data/valid/burntsushi/valid/table/array-nest.json new file mode 100644 index 0000000..97f55c8 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-nest.json @@ -0,0 +1,44 @@ +{ + "albums": [ + { + "name": { + "type": "string", + "value": "Born to Run" + }, + "songs": [ + { + "name": { + "type": "string", + "value": "Jungleland" + } + }, + { + "name": { + "type": "string", + "value": "Meeting Across the River" + } + } + ] + }, + { + "name": { + "type": "string", + "value": "Born in the USA" + }, + "songs": [ + { + "name": { + "type": "string", + "value": "Glory Days" + } + }, + { + "name": { + "type": "string", + "value": "Dancing in the Dark" + } + } + ] + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/table/array-nest.toml b/tests/data/valid/burntsushi/valid/table/array-nest.toml new file mode 100644 index 0000000..d659a3d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-nest.toml @@ -0,0 +1,17 @@ +[[albums]] +name = "Born to Run" + + [[albums.songs]] + name = "Jungleland" + + [[albums.songs]] + name = "Meeting Across the River" + +[[albums]] +name = "Born in the USA" + + [[albums.songs]] + name = "Glory Days" + + [[albums.songs]] + name = "Dancing in the Dark" diff --git a/tests/data/valid/burntsushi/valid/table/array-one.json b/tests/data/valid/burntsushi/valid/table/array-one.json new file mode 100644 index 0000000..5cd67de --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-one.json @@ -0,0 +1,14 @@ +{ + "people": [ + { + "first_name": { + "type": "string", + "value": "Bruce" + }, + "last_name": { + "type": "string", + "value": "Springsteen" + } + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/table/array-one.toml b/tests/data/valid/burntsushi/valid/table/array-one.toml new file mode 100644 index 0000000..cd7e1b6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-one.toml @@ -0,0 +1,3 @@ +[[people]] +first_name = "Bruce" +last_name = "Springsteen" diff --git a/tests/data/valid/burntsushi/valid/table/array-table-array.json b/tests/data/valid/burntsushi/valid/table/array-table-array.json new file mode 100644 index 0000000..5c3d649 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-table-array.json @@ -0,0 +1,24 @@ +{ + "a": [ + { + "b": [ + { + "c": { + "d": { + "type": "string", + "value": "val0" + } + } + }, + { + "c": { + "d": { + "type": "string", + "value": "val1" + } + } + } + ] + } + ] +} diff --git a/tests/data/valid/burntsushi/valid/table/array-table-array.toml b/tests/data/valid/burntsushi/valid/table/array-table-array.toml new file mode 100644 index 0000000..a07b0c7 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/array-table-array.toml @@ -0,0 +1,7 @@ +[[a]] + [[a.b]] + [a.b.c] + d = "val0" + [[a.b]] + [a.b.c] + d = "val1" diff --git a/tests/data/valid/burntsushi/valid/table/empty.json b/tests/data/valid/burntsushi/valid/table/empty.json new file mode 100644 index 0000000..3e82cda --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/empty.json @@ -0,0 +1,3 @@ +{ + "a": {} +} diff --git a/tests/data/valid/burntsushi/valid/table/empty.toml b/tests/data/valid/burntsushi/valid/table/empty.toml new file mode 100644 index 0000000..8bb6a0a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/empty.toml @@ -0,0 +1 @@ +[a] diff --git a/tests/data/valid/burntsushi/valid/table/keyword.json b/tests/data/valid/burntsushi/valid/table/keyword.json new file mode 100644 index 0000000..a15dfae --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/keyword.json @@ -0,0 +1,6 @@ +{ + "true": {}, + "false": {}, + "inf": {}, + "nan": {} +} diff --git a/tests/data/valid/burntsushi/valid/table/keyword.toml b/tests/data/valid/burntsushi/valid/table/keyword.toml new file mode 100644 index 0000000..bc3d52a --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/keyword.toml @@ -0,0 +1,9 @@ +[true] + +[false] + +[inf] + +[nan] + + diff --git a/tests/data/valid/burntsushi/valid/table/names.json b/tests/data/valid/burntsushi/valid/table/names.json new file mode 100644 index 0000000..66d8ea5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/names.json @@ -0,0 +1,30 @@ +{ + "a": { + " x ": {}, + "b": { + "c": {} + }, + "b.c": {}, + "d.e": {} + }, + "d": { + "e": { + "f": {} + } + }, + "g": { + "h": { + "i": {} + } + }, + "j": { + "ʞ": { + "l": {} + } + }, + "x": { + "1": { + "2": {} + } + } +} diff --git a/tests/data/valid/burntsushi/valid/table/names.toml b/tests/data/valid/burntsushi/valid/table/names.toml new file mode 100644 index 0000000..092da2f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/names.toml @@ -0,0 +1,9 @@ +[a.b.c] +[a."b.c"] +[a.'d.e'] +[a.' x '] +[ d.e.f ] +[ g . h . i ] +[ j . "ʞ" . 'l' ] + +[x.1.2] diff --git a/tests/data/valid/burntsushi/valid/table/no-eol.json b/tests/data/valid/burntsushi/valid/table/no-eol.json new file mode 100644 index 0000000..b6e7fb5 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/no-eol.json @@ -0,0 +1,3 @@ +{ + "table": {} +} diff --git a/tests/data/valid/burntsushi/valid/table/no-eol.toml b/tests/data/valid/burntsushi/valid/table/no-eol.toml new file mode 100644 index 0000000..f1098fd --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/no-eol.toml @@ -0,0 +1 @@ +[table] diff --git a/tests/data/valid/burntsushi/valid/table/sub-empty.json b/tests/data/valid/burntsushi/valid/table/sub-empty.json new file mode 100644 index 0000000..ed10cd2 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/sub-empty.json @@ -0,0 +1,5 @@ +{ + "a": { + "b": {} + } +} diff --git a/tests/data/valid/burntsushi/valid/table/sub-empty.toml b/tests/data/valid/burntsushi/valid/table/sub-empty.toml new file mode 100644 index 0000000..70b7fe1 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/sub-empty.toml @@ -0,0 +1,2 @@ +[a] +[a.b] diff --git a/tests/data/valid/burntsushi/valid/table/whitespace.json b/tests/data/valid/burntsushi/valid/table/whitespace.json new file mode 100644 index 0000000..c770470 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/whitespace.json @@ -0,0 +1,3 @@ +{ + "valid key": {} +} diff --git a/tests/data/valid/burntsushi/valid/table/whitespace.toml b/tests/data/valid/burntsushi/valid/table/whitespace.toml new file mode 100644 index 0000000..daf881d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/whitespace.toml @@ -0,0 +1 @@ +["valid key"] diff --git a/tests/data/valid/burntsushi/valid/table/with-literal-string.json b/tests/data/valid/burntsushi/valid/table/with-literal-string.json new file mode 100644 index 0000000..7784695 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/with-literal-string.json @@ -0,0 +1,12 @@ +{ + "a": { + "\"b\"": { + "c": { + "answer": { + "type": "integer", + "value": "42" + } + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/table/with-literal-string.toml b/tests/data/valid/burntsushi/valid/table/with-literal-string.toml new file mode 100644 index 0000000..b81643d --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/with-literal-string.toml @@ -0,0 +1,4 @@ +['a'] +[a.'"b"'] +[a.'"b"'.c] +answer = 42 diff --git a/tests/data/valid/burntsushi/valid/table/with-pound.json b/tests/data/valid/burntsushi/valid/table/with-pound.json new file mode 100644 index 0000000..f32d2f2 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/with-pound.json @@ -0,0 +1,8 @@ +{ + "key#group": { + "answer": { + "type": "integer", + "value": "42" + } + } +} diff --git a/tests/data/valid/burntsushi/valid/table/with-pound.toml b/tests/data/valid/burntsushi/valid/table/with-pound.toml new file mode 100644 index 0000000..33f2c4f --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/with-pound.toml @@ -0,0 +1,2 @@ +["key#group"] +answer = 42 diff --git a/tests/data/valid/burntsushi/valid/table/with-single-quotes.json b/tests/data/valid/burntsushi/valid/table/with-single-quotes.json new file mode 100644 index 0000000..347c693 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/with-single-quotes.json @@ -0,0 +1,12 @@ +{ + "a": { + "b": { + "c": { + "answer": { + "type": "integer", + "value": "42" + } + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/table/with-single-quotes.toml b/tests/data/valid/burntsushi/valid/table/with-single-quotes.toml new file mode 100644 index 0000000..56e52cc --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/with-single-quotes.toml @@ -0,0 +1,4 @@ +['a'] +[a.'b'] +[a.'b'.c] +answer = 42 diff --git a/tests/data/valid/burntsushi/valid/table/without-super.json b/tests/data/valid/burntsushi/valid/table/without-super.json new file mode 100644 index 0000000..3c390c6 --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/without-super.json @@ -0,0 +1,9 @@ +{ + "x": { + "y": { + "z": { + "w": {} + } + } + } +} diff --git a/tests/data/valid/burntsushi/valid/table/without-super.toml b/tests/data/valid/burntsushi/valid/table/without-super.toml new file mode 100644 index 0000000..73ed68b --- /dev/null +++ b/tests/data/valid/burntsushi/valid/table/without-super.toml @@ -0,0 +1,5 @@ +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work +[x] # defining a super-table afterwards is ok |