more tests

This commit is contained in:
CK Tan 2021-03-07 17:41:18 -08:00
parent dbc1ef26d6
commit 369fd2451b
14 changed files with 135 additions and 0 deletions

11
stdex/arrtab1.toml Normal file
View File

@ -0,0 +1,11 @@
[[products]]
name = "Hammer"
sku = 738594937
[[products]] # empty table within the array
[[products]]
name = "Nail"
sku = 284758393
color = "gray"

15
stdex/arrtab1.toml.res Normal file
View File

@ -0,0 +1,15 @@
{
products = [
{
name = "Hammer",
sku = 738594937,
},
{
},
{
name = "Nail",
sku = 284758393,
color = "gray",
},
],
}

19
stdex/arrtab2.toml Normal file
View File

@ -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"

27
stdex/arrtab2.toml.res Normal file
View File

@ -0,0 +1,27 @@
{
fruits = [
{
name = "apple",
varieties = [
{
name = "red delicious",
},
{
name = "granny smith",
},
],
physical = {
color = "red",
shape = "round",
},
},
{
name = "banana",
varieties = [
{
name = "plantain",
},
],
},
],
}

8
stdex/arrtab3.toml Normal file
View File

@ -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"

1
stdex/arrtab3.toml.res Normal file
View File

@ -0,0 +1 @@
ERROR: line 6: key exists

4
stdex/arrtab4.toml Normal file
View File

@ -0,0 +1,4 @@
# INVALID TOML DOC
fruits = []
[[fruits]] # Not allowed

1
stdex/arrtab4.toml.res Normal file
View File

@ -0,0 +1 @@
ERROR: line 4: array mismatch

11
stdex/arrtab5.toml Normal file
View File

@ -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"

1
stdex/arrtab5.toml.res Normal file
View File

@ -0,0 +1 @@
ERROR: line 9: key exists

14
stdex/arrtab6.toml Normal file
View File

@ -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"

1
stdex/arrtab6.toml.res Normal file
View File

@ -0,0 +1 @@
ERROR: line 13: key exists

3
stdex/arrtab7.toml Normal file
View File

@ -0,0 +1,3 @@
points = [ { x = 1, y = 2, z = 3 },
{ x = 7, y = 8, z = 9 },
{ x = 2, y = 4, z = 8 } ]

19
stdex/arrtab7.toml.res Normal file
View File

@ -0,0 +1,19 @@
{
points = [
{
x = 1,
y = 2,
z = 3,
},
{
x = 7,
y = 8,
z = 9,
},
{
x = 2,
y = 4,
z = 8,
},
],
}