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/invalid/toml-lang-compliance | |
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/invalid/toml-lang-compliance')
55 files changed, 160 insertions, 0 deletions
diff --git a/tests/data/invalid/toml-lang-compliance/LICENSE b/tests/data/invalid/toml-lang-compliance/LICENSE new file mode 100644 index 0000000..cbcecb2 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/LICENSE @@ -0,0 +1,23 @@ +The MIT License + +Copyright (c) 2021 Pradyun Gedam and Contributors + +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. + +Portions of the Software include code copyright (c) Rebecca Turner. diff --git a/tests/data/invalid/toml-lang-compliance/README.md b/tests/data/invalid/toml-lang-compliance/README.md new file mode 100644 index 0000000..1c2f2e5 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/README.md @@ -0,0 +1,6 @@ +These test cases are copied from +https://github.com/pyrmont/toml-specs/tree/989fdfb02f6ca0a9e3b0a09b5e5f5283e02f1fa7 + +There is an open PR (https://github.com/toml-lang/compliance/pull/8) to merge the tests into +https://github.com/toml-lang/compliance +after which we should sync the tests with that repository. diff --git a/tests/data/invalid/toml-lang-compliance/invalid/array/array-of-tables-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/array/array-of-tables-1.toml new file mode 100644 index 0000000..01d4d13 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/array/array-of-tables-1.toml @@ -0,0 +1,4 @@ +# INVALID TOML DOC +fruit = [] + +[[fruit]] # Not allowed diff --git a/tests/data/invalid/toml-lang-compliance/invalid/array/array-of-tables-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/array/array-of-tables-2.toml new file mode 100644 index 0000000..a77b0e4 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/array/array-of-tables-2.toml @@ -0,0 +1,10 @@ +# INVALID TOML DOC +[[fruit]] + name = "apple" + + [[fruit.variety]] + name = "red delicious" + + # This table conflicts with the previous table + [fruit.variety] + name = "granny smith" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-1.toml Binary files differnew file mode 100644 index 0000000..1884b6d --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-1.toml diff --git a/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-2.toml new file mode 100644 index 0000000..ed63dfc --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-2.toml @@ -0,0 +1 @@ +a = "ctrl-P" # diff --git a/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-3.toml new file mode 100644 index 0000000..9830b75 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-3.toml @@ -0,0 +1 @@ +a = "ctrl-_" # diff --git a/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-4.toml new file mode 100644 index 0000000..f7fd9bb --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/comment/comment-control-4.toml @@ -0,0 +1 @@ +a = "0x7f" # diff --git a/tests/data/invalid/toml-lang-compliance/invalid/integer/int-0-padded.toml b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-0-padded.toml new file mode 100644 index 0000000..74b4032 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-0-padded.toml @@ -0,0 +1 @@ +int = 0123 diff --git a/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-bin.toml b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-bin.toml new file mode 100644 index 0000000..f9397f1 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-bin.toml @@ -0,0 +1 @@ +bin = +0b10 diff --git a/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-hex.toml b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-hex.toml new file mode 100644 index 0000000..898b957 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-hex.toml @@ -0,0 +1 @@ +hex = +0xab diff --git a/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-oct.toml b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-oct.toml new file mode 100644 index 0000000..e8219cd --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/integer/int-signed-oct.toml @@ -0,0 +1 @@ +oct = +0o23 diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-1.toml new file mode 100644 index 0000000..e50dbe3 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-1.toml @@ -0,0 +1 @@ +bare!key = 123 diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-2.toml new file mode 100644 index 0000000..24acaa1 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-2.toml @@ -0,0 +1,2 @@ +barekey + = 123 diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-3.toml new file mode 100644 index 0000000..03d0e0d --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/bare-key-3.toml @@ -0,0 +1 @@ +barekey = diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/key-value-pair-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/key-value-pair-1.toml new file mode 100644 index 0000000..56f085a --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/key-value-pair-1.toml @@ -0,0 +1 @@ +key = # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/key-value-pair-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/key-value-pair-2.toml new file mode 100644 index 0000000..e05c47c --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/key-value-pair-2.toml @@ -0,0 +1 @@ +first = "Tom" last = "Preston-Werner" # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/multiple-dot-key.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/multiple-dot-key.toml new file mode 100644 index 0000000..a6c5ea6 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/multiple-dot-key.toml @@ -0,0 +1,8 @@ +# THE FOLLOWING IS INVALID + +# This defines the value of fruit.apple to be an integer. +fruit.apple = 1 + +# But then this treats fruit.apple like it's a table. +# You can't turn an integer into a table. +fruit.apple.smooth = true diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/multiple-key.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/multiple-key.toml new file mode 100644 index 0000000..7847bd4 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/multiple-key.toml @@ -0,0 +1,3 @@ +# DO NOT DO THIS +name = "Tom" +name = "Pradyun" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/key-value/no-key-name.toml b/tests/data/invalid/toml-lang-compliance/invalid/key-value/no-key-name.toml new file mode 100644 index 0000000..cd9fa90 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/key-value/no-key-name.toml @@ -0,0 +1 @@ += "no key name" # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-1.toml Binary files differnew file mode 100644 index 0000000..351f8c7 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-1.toml diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-2.toml new file mode 100644 index 0000000..166e7ff --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-2.toml @@ -0,0 +1 @@ +a = "ctrl-P" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-3.toml new file mode 100644 index 0000000..904751f --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-3.toml @@ -0,0 +1 @@ +a = "ctrl-_" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-4.toml new file mode 100644 index 0000000..f778604 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-control-4.toml @@ -0,0 +1 @@ +a = "0x7f" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-1.toml Binary files differnew file mode 100644 index 0000000..5b45dcd --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-1.toml diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-2.toml new file mode 100644 index 0000000..bb7eeb6 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-2.toml @@ -0,0 +1 @@ +a = """null""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-3.toml new file mode 100644 index 0000000..45e378f --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-3.toml @@ -0,0 +1 @@ +a = """null""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-4.toml new file mode 100644 index 0000000..7d788a8 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-control-4.toml @@ -0,0 +1 @@ +a = """null""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-invalid-backslash.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-invalid-backslash.toml new file mode 100644 index 0000000..13570d3 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-invalid-backslash.toml @@ -0,0 +1,3 @@ +a = """ + foo \ \n + bar""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-out-of-range-unicode-escape-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-out-of-range-unicode-escape-1.toml new file mode 100644 index 0000000..b27e203 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-out-of-range-unicode-escape-1.toml @@ -0,0 +1 @@ +a = """\UFFFFFFFF""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-out-of-range-unicode-escape-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-out-of-range-unicode-escape-2.toml new file mode 100644 index 0000000..17a9361 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-out-of-range-unicode-escape-2.toml @@ -0,0 +1 @@ +a = """\U00D80000""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-quotes.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-quotes.toml new file mode 100644 index 0000000..02ebf13 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-quotes.toml @@ -0,0 +1 @@ +str5 = """Here are three quotation marks: """.""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-unknown-escape.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-unknown-escape.toml new file mode 100644 index 0000000..35c5cc5 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-multiline-unknown-escape.toml @@ -0,0 +1 @@ +a = """\@""" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-out-of-range-unicode-escape-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-out-of-range-unicode-escape-1.toml new file mode 100644 index 0000000..ada1f55 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-out-of-range-unicode-escape-1.toml @@ -0,0 +1 @@ +a = "\UFFFFFFFF" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-out-of-range-unicode-escape-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-out-of-range-unicode-escape-2.toml new file mode 100644 index 0000000..d4833b3 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-out-of-range-unicode-escape-2.toml @@ -0,0 +1 @@ +a = "\U00D80000" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-unknown-escape.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-unknown-escape.toml new file mode 100644 index 0000000..381dd85 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-basic-unknown-escape.toml @@ -0,0 +1 @@ +a = "\@" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-1.toml Binary files differnew file mode 100644 index 0000000..337fdc4 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-1.toml diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-2.toml new file mode 100644 index 0000000..a09c908 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-2.toml @@ -0,0 +1 @@ +a = 'null' diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-3.toml new file mode 100644 index 0000000..74697de --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-3.toml @@ -0,0 +1 @@ +a = 'null' diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-4.toml new file mode 100644 index 0000000..6c11637 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-control-4.toml @@ -0,0 +1 @@ +a = 'null' diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-1.toml Binary files differnew file mode 100644 index 0000000..8510285 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-1.toml diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-2.toml new file mode 100644 index 0000000..9c02f11 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-2.toml @@ -0,0 +1 @@ +a = '''null''' diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-4.toml new file mode 100644 index 0000000..da40ffc --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-control-4.toml @@ -0,0 +1 @@ +a = '''null''' diff --git a/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-quotes.toml b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-quotes.toml new file mode 100644 index 0000000..4b97a2a --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/string/string-literal-multiline-quotes.toml @@ -0,0 +1 @@ +apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-immutable-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-immutable-1.toml new file mode 100644 index 0000000..7689e14 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-immutable-1.toml @@ -0,0 +1,3 @@ +[product] +type = { name = "Nail" } +type.edible = false # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-immutable-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-immutable-2.toml new file mode 100644 index 0000000..d6937eb --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-immutable-2.toml @@ -0,0 +1,3 @@ +[product] +type.name = "Nail" +type = { edible = false } # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-trailing-comma.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-trailing-comma.toml new file mode 100644 index 0000000..59618e1 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/inline-table-trailing-comma.toml @@ -0,0 +1 @@ +abc = { abc = 123, } diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-1.toml new file mode 100644 index 0000000..0704ba7 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-1.toml @@ -0,0 +1,7 @@ +# DO NOT DO THIS + +[fruit] +apple = "red" + +[fruit] +orange = "orange" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-2.toml new file mode 100644 index 0000000..e58bf8e --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-2.toml @@ -0,0 +1,7 @@ +# DO NOT DO THIS EITHER + +[fruit] +apple = "red" + +[fruit.apple] +texture = "smooth" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-3.toml new file mode 100644 index 0000000..9eac5f6 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-3.toml @@ -0,0 +1,5 @@ +[fruit] +apple.color = "red" +apple.taste.sweet = true + +[fruit.apple] # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-4.toml new file mode 100644 index 0000000..43dfb39 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-4.toml @@ -0,0 +1,5 @@ +[fruit] +apple.color = "red" +apple.taste.sweet = true + +[fruit.apple.taste] # INVALID diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-1.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-1.toml new file mode 100644 index 0000000..7609d79 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-1.toml @@ -0,0 +1,7 @@ +[fruit.physical] # subtable, but to which parent element should it belong? + color = "red" + shape = "round" + +[[fruit]] # parser must throw an error upon discovering that "fruit" is + # an array rather than a table + name = "apple" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-2.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-2.toml new file mode 100644 index 0000000..01d4d13 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-2.toml @@ -0,0 +1,4 @@ +# INVALID TOML DOC +fruit = [] + +[[fruit]] # Not allowed diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-3.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-3.toml new file mode 100644 index 0000000..792cbd1 --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-3.toml @@ -0,0 +1,14 @@ +# INVALID TOML DOC +[[fruit]] + name = "apple" + + [[fruit.variety]] + name = "red delicious" + + # INVALID: This table conflicts with the previous array of tables + [fruit.variety] + name = "granny smith" + + [fruit.physical] + color = "red" + shape = "round" diff --git a/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-4.toml b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-4.toml new file mode 100644 index 0000000..3ba51fb --- /dev/null +++ b/tests/data/invalid/toml-lang-compliance/invalid/table/table-invalid-4.toml @@ -0,0 +1,14 @@ +# INVALID TOML DOC +[[fruit]] + name = "apple" + + [[fruit.variety]] + name = "red delicious" + + [fruit.physical] + color = "red" + shape = "round" + + # INVALID: This array of tables conflicts with the previous table + [[fruit.physical]] + color = "green" |