more tests
This commit is contained in:
parent
dbc1ef26d6
commit
369fd2451b
|
@ -0,0 +1,11 @@
|
||||||
|
[[products]]
|
||||||
|
name = "Hammer"
|
||||||
|
sku = 738594937
|
||||||
|
|
||||||
|
[[products]] # empty table within the array
|
||||||
|
|
||||||
|
[[products]]
|
||||||
|
name = "Nail"
|
||||||
|
sku = 284758393
|
||||||
|
|
||||||
|
color = "gray"
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
products = [
|
||||||
|
{
|
||||||
|
name = "Hammer",
|
||||||
|
sku = 738594937,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "Nail",
|
||||||
|
sku = 284758393,
|
||||||
|
color = "gray",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
[[fruits]]
|
||||||
|
name = "apple"
|
||||||
|
|
||||||
|
[fruits.physical] # subtable
|
||||||
|
color = "red"
|
||||||
|
shape = "round"
|
||||||
|
|
||||||
|
[[fruits.varieties]] # nested array of tables
|
||||||
|
name = "red delicious"
|
||||||
|
|
||||||
|
[[fruits.varieties]]
|
||||||
|
name = "granny smith"
|
||||||
|
|
||||||
|
|
||||||
|
[[fruits]]
|
||||||
|
name = "banana"
|
||||||
|
|
||||||
|
[[fruits.varieties]]
|
||||||
|
name = "plantain"
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
fruits = [
|
||||||
|
{
|
||||||
|
name = "apple",
|
||||||
|
varieties = [
|
||||||
|
{
|
||||||
|
name = "red delicious",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "granny smith",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
physical = {
|
||||||
|
color = "red",
|
||||||
|
shape = "round",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "banana",
|
||||||
|
varieties = [
|
||||||
|
{
|
||||||
|
name = "plantain",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
# INVALID TOML DOC
|
||||||
|
[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"
|
|
@ -0,0 +1 @@
|
||||||
|
ERROR: line 6: key exists
|
|
@ -0,0 +1,4 @@
|
||||||
|
# INVALID TOML DOC
|
||||||
|
fruits = []
|
||||||
|
|
||||||
|
[[fruits]] # Not allowed
|
|
@ -0,0 +1 @@
|
||||||
|
ERROR: line 4: array mismatch
|
|
@ -0,0 +1,11 @@
|
||||||
|
# INVALID TOML DOC
|
||||||
|
[[fruits]]
|
||||||
|
name = "apple"
|
||||||
|
|
||||||
|
[[fruits.varieties]]
|
||||||
|
name = "red delicious"
|
||||||
|
|
||||||
|
# INVALID: This table conflicts with the previous array of tables
|
||||||
|
[fruits.varieties]
|
||||||
|
name = "granny smith"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
ERROR: line 9: key exists
|
|
@ -0,0 +1,14 @@
|
||||||
|
# INVALID TOML DOC
|
||||||
|
[[fruits]]
|
||||||
|
name = "apple"
|
||||||
|
|
||||||
|
[[fruits.varieties]]
|
||||||
|
name = "red delicious"
|
||||||
|
|
||||||
|
[fruits.physical]
|
||||||
|
color = "red"
|
||||||
|
shape = "round"
|
||||||
|
|
||||||
|
# INVALID: This array of tables conflicts with the previous table
|
||||||
|
[[fruits.physical]]
|
||||||
|
color = "green"
|
|
@ -0,0 +1 @@
|
||||||
|
ERROR: line 13: key exists
|
|
@ -0,0 +1,3 @@
|
||||||
|
points = [ { x = 1, y = 2, z = 3 },
|
||||||
|
{ x = 7, y = 8, z = 9 },
|
||||||
|
{ x = 2, y = 4, z = 8 } ]
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
points = [
|
||||||
|
{
|
||||||
|
x = 1,
|
||||||
|
y = 2,
|
||||||
|
z = 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x = 7,
|
||||||
|
y = 8,
|
||||||
|
z = 9,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x = 2,
|
||||||
|
y = 4,
|
||||||
|
z = 8,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
Loading…
Reference in New Issue