-
-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
127 changed files
with
1,438 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Invalid codepoint U+D800 : ��� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v = Inf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v = NaN |
1 change: 1 addition & 0 deletions
1
internal/toml-test/tests/invalid/inline-table/bad-key-syntax.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tbl = { a = 1, [b] } |
1 change: 1 addition & 0 deletions
1
internal/toml-test/tests/invalid/inline-table/dotted-key-conflict.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tbl = { a.b = "a_b", a.b.c = "a_b_c" } |
2 changes: 2 additions & 0 deletions
2
internal/toml-test/tests/invalid/inline-table/nested_key_conflict.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tbl = { fruit = { apple.color = "red" }, fruit.apple.texture = { smooth = true } } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[product] | ||
type = { name = "Nail" } | ||
type.edible = false # INVALID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[product] | ||
type.name = "Nail" | ||
type = { edible = false } # INVALID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
key = # INVALID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
= "no key name" # INVALID | ||
"" = "blank" # VALID but discouraged | ||
'' = 'blank' # VALID but discouraged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
str4 = """Here are two quotation marks: "". Simple enough.""" | ||
str5 = """Here are three quotation marks: """.""" # INVALID | ||
str5 = """Here are three quotation marks: ""\".""" | ||
str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" | ||
|
||
# "This," she said, "is just a pointless statement." | ||
str7 = """"This," she said, "is just a pointless statement."""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
quot15 = '''Here are fifteen quotation marks: """""""""""""""''' | ||
|
||
apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID | ||
apos15 = "Here are fifteen apostrophes: '''''''''''''''" | ||
|
||
# 'That,' she said, 'is still pointless.' | ||
str = ''''That,' she said, 'is still pointless.'''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[fruit] | ||
apple.color = "red" | ||
apple.taste.sweet = true | ||
|
||
[fruit.apple] # INVALID | ||
# [fruit.apple.taste] # INVALID | ||
|
||
[fruit.apple.texture] # you can add sub-tables | ||
smooth = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[fruit] | ||
apple.color = "red" | ||
apple.taste.sweet = true | ||
|
||
# [fruit.apple] # INVALID | ||
[fruit.apple.taste] # INVALID | ||
|
||
[fruit.apple.texture] # you can add sub-tables | ||
smooth = true |
4 changes: 4 additions & 0 deletions
4
internal/toml-test/tests/invalid/table/append-to-array-with-dotted-keys.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[[a.b]] | ||
|
||
[a] | ||
b.y = 2 |
4 changes: 4 additions & 0 deletions
4
internal/toml-test/tests/invalid/table/duplicate-key-dotted-array.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[fruit] | ||
apple.color = "red" | ||
|
||
[[fruit.apple]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ~ ÿ 𐀀 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"": { | ||
"x": { | ||
"type": "string", | ||
"value": "empty.x" | ||
} | ||
}, | ||
"x": { | ||
"": { | ||
"type": "string", | ||
"value": "x.empty" | ||
} | ||
}, | ||
"a": { | ||
"": { | ||
"": { | ||
"type": "string", | ||
"value": "empty.empty" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
''.x = "empty.x" | ||
x."" = "x.empty" | ||
[a] | ||
"".'' = "empty.empty" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"\u0000": { | ||
"type": "string", | ||
"value": "null" | ||
}, | ||
"\\u0000": { | ||
"type": "string", | ||
"value": "different key" | ||
}, | ||
"\b \f A \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \ud800\udc00 \udbff\udfff": { | ||
"type": "string", | ||
"value": "escaped key" | ||
}, | ||
"~ \u0080 \u00ff \ud7ff \ue000 \uffff \ud800\udc00 \udbff\udfff": { | ||
"type": "string", | ||
"value": "basic key" | ||
}, | ||
"l ~ \u0080 \u00ff \ud7ff \ue000 \uffff \ud800\udc00 \udbff\udfff": { | ||
"type": "string", | ||
"value": "literal key" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
"\u0000" = "null" | ||
'\u0000' = "different key" | ||
"\u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff" = "escaped key" | ||
|
||
"~ ÿ 𐀀 " = "basic key" | ||
'l ~ ÿ 𐀀 ' = "literal key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
{ | ||
"colors": [ | ||
{ | ||
"type": "string", | ||
"value": "red" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "yellow" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "green" | ||
} | ||
], | ||
"contributors": [ | ||
{ | ||
"type": "string", | ||
"value": "Foo Bar \u003c[email protected]\u003e" | ||
}, | ||
{ | ||
"email": { | ||
"type": "string", | ||
"value": "[email protected]" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"value": "Baz Qux" | ||
}, | ||
"url": { | ||
"type": "string", | ||
"value": "https://example.com/bazqux" | ||
} | ||
} | ||
], | ||
"integers": [ | ||
{ | ||
"type": "integer", | ||
"value": "1" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "2" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "3" | ||
} | ||
], | ||
"nested_arrays_of_ints": [ | ||
[ | ||
{ | ||
"type": "integer", | ||
"value": "1" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "2" | ||
} | ||
], | ||
[ | ||
{ | ||
"type": "integer", | ||
"value": "3" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "4" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "5" | ||
} | ||
] | ||
], | ||
"nested_mixed_array": [ | ||
[ | ||
{ | ||
"type": "integer", | ||
"value": "1" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "2" | ||
} | ||
], | ||
[ | ||
{ | ||
"type": "string", | ||
"value": "a" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "b" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "c" | ||
} | ||
] | ||
], | ||
"numbers": [ | ||
{ | ||
"type": "float", | ||
"value": "0.1" | ||
}, | ||
{ | ||
"type": "float", | ||
"value": "0.2" | ||
}, | ||
{ | ||
"type": "float", | ||
"value": "0.5" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "1" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "2" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "5" | ||
} | ||
], | ||
"string_array": [ | ||
{ | ||
"type": "string", | ||
"value": "all" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "strings" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "are the same" | ||
}, | ||
{ | ||
"type": "string", | ||
"value": "type" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
integers = [ 1, 2, 3 ] | ||
colors = [ "red", "yellow", "green" ] | ||
nested_arrays_of_ints = [ [ 1, 2 ], [3, 4, 5] ] | ||
nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ] | ||
string_array = [ "all", 'strings', """are the same""", '''type''' ] | ||
|
||
# Mixed-type arrays are allowed | ||
numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ] | ||
contributors = [ | ||
"Foo Bar <[email protected]>", | ||
{ name = "Baz Qux", email = "[email protected]", url = "https://example.com/bazqux" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"integers2": [ | ||
{ | ||
"type": "integer", | ||
"value": "1" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "2" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "3" | ||
} | ||
], | ||
"integers3": [ | ||
{ | ||
"type": "integer", | ||
"value": "1" | ||
}, | ||
{ | ||
"type": "integer", | ||
"value": "2" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
integers2 = [ | ||
1, 2, 3 | ||
] | ||
|
||
integers3 = [ | ||
1, | ||
2, # this is ok | ||
] |
29 changes: 29 additions & 0 deletions
29
internal/toml-test/tests/valid/spec/array-of-tables-0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"products": [ | ||
{ | ||
"name": { | ||
"type": "string", | ||
"value": "Hammer" | ||
}, | ||
"sku": { | ||
"type": "integer", | ||
"value": "738594937" | ||
} | ||
}, | ||
{}, | ||
{ | ||
"color": { | ||
"type": "string", | ||
"value": "gray" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"value": "Nail" | ||
}, | ||
"sku": { | ||
"type": "integer", | ||
"value": "284758393" | ||
} | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
internal/toml-test/tests/valid/spec/array-of-tables-0.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[products]] | ||
name = "Hammer" | ||
sku = 738594937 | ||
|
||
[[products]] # empty table within the array | ||
|
||
[[products]] | ||
name = "Nail" | ||
sku = 284758393 | ||
|
||
color = "gray" |
Oops, something went wrong.