Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
- Fix json to proper format
- Remove deprecated options tests
- Show file that is being tested
  • Loading branch information
nikolauska committed Feb 11, 2018
1 parent b28dd76 commit 69f2e95
Show file tree
Hide file tree
Showing 37 changed files with 134 additions and 321 deletions.
10 changes: 1 addition & 9 deletions test/toml/valid/array-empty.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"thevoid": { "type": "array", "value": [
{"type": "array", "value": [
{"type": "array", "value": [
{"type": "array", "value": [
{"type": "array", "value": []}
]}
]}
]}
]}
"thevoid": [[[[[]]]]]
}
9 changes: 1 addition & 8 deletions test/toml/valid/array-nospaces.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"ints": {
"type": "array",
"value": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
]
}
"ints": [1, 2, 3]
}
18 changes: 1 addition & 17 deletions test/toml/valid/arrays-hetergeneous.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
{
"mixed": {
"type": "array",
"value": [
{"type": "array", "value": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
]},
{"type": "array", "value": [
{"type": "string", "value": "a"},
{"type": "string", "value": "b"}
]},
{"type": "array", "value": [
{"type": "float", "value": "1.1"},
{"type": "float", "value": "2.1"}
]}
]
}
"mixed": [[1, 2], ["a", "b"], [1.1, 2.1]]
}
12 changes: 1 addition & 11 deletions test/toml/valid/arrays-nested.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
{
"nest": {
"type": "array",
"value": [
{"type": "array", "value": [
{"type": "string", "value": "a"}
]},
{"type": "array", "value": [
{"type": "string", "value": "b"}
]}
]
}
"nest": [["a"], ["b"]]
}
36 changes: 4 additions & 32 deletions test/toml/valid/arrays.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
{
"ints": {
"type": "array",
"value": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
]
},
"floats": {
"type": "array",
"value": [
{"type": "float", "value": "1.1"},
{"type": "float", "value": "2.1"},
{"type": "float", "value": "3.1"}
]
},
"strings": {
"type": "array",
"value": [
{"type": "string", "value": "a"},
{"type": "string", "value": "b"},
{"type": "string", "value": "c"}
]
},
"dates": {
"type": "array",
"value": [
{"type": "datetime", "value": "1987-07-05T17:45:00Z"},
{"type": "datetime", "value": "1979-05-27T07:32:00Z"},
{"type": "datetime", "value": "2006-06-01T11:00:00Z"}
]
}
"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"]
}
4 changes: 2 additions & 2 deletions test/toml/valid/bool.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"f": {"type": "bool", "value": "false"},
"t": {"type": "bool", "value": "true"}
"f": false,
"t": true
}
14 changes: 4 additions & 10 deletions test/toml/valid/comments-everywhere.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"group": {
"answer": {"type": "integer", "value": "42"},
"more": {
"type": "array",
"value": [
{"type": "integer", "value": "42"},
{"type": "integer", "value": "42"}
]
}
}
"group": {
"answer": 42,
"more": [42, 42]
}
}
2 changes: 1 addition & 1 deletion test/toml/valid/datetime.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"bestdayever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}
"bestdayever": "1987-07-05T17:45:00Z"
}
13 changes: 3 additions & 10 deletions test/toml/valid/example.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"best-day-ever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"},
"best-day-ever": "1987-07-05T17:45:00Z",
"numtheory": {
"boring": {"type": "bool", "value": "false"},
"perfection": {
"type": "array",
"value": [
{"type": "integer", "value": "6"},
{"type": "integer", "value": "28"},
{"type": "integer", "value": "496"}
]
}
"boring": false,
"perfection": [6, 28, 496]
}
}
4 changes: 2 additions & 2 deletions test/toml/valid/float.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"pi": {"type": "float", "value": "3.14"},
"negpi": {"type": "float", "value": "-3.14"}
"pi": 3.14,
"negpi": -3.14
}
14 changes: 7 additions & 7 deletions test/toml/valid/implicit-and-explicit-after.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a": {
"better": {"type": "integer", "value": "43"},
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
"a": {
"better": 43,
"b": {
"c": {
"answer": 42
}
}
}
}
14 changes: 7 additions & 7 deletions test/toml/valid/implicit-and-explicit-before.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a": {
"better": {"type": "integer", "value": "43"},
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
"a": {
"better": 43,
"b": {
"c": {
"answer": 42
}
}
}
}
12 changes: 6 additions & 6 deletions test/toml/valid/implicit-groups.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"a": {
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
"a": {
"b": {
"c": {
"answer": 42
}
}
}
}
4 changes: 2 additions & 2 deletions test/toml/valid/integer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"answer": {"type": "integer", "value": "42"},
"neganswer": {"type": "integer", "value": "-42"}
"answer": 42,
"neganswer": -42
}
2 changes: 1 addition & 1 deletion test/toml/valid/key-equals-nospace.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"answer": {"type": "integer", "value": "42"}
"answer": 42
}
2 changes: 1 addition & 1 deletion test/toml/valid/key-space.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"a b": {"type": "integer", "value": "1"}
"a b": 1
}
4 changes: 1 addition & 3 deletions test/toml/valid/key-special-chars.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"~!@$^&*()_+-`1234567890[]|/?><.,;:'": {
"type": "integer", "value": "1"
}
"~!@$^&*()_+-`1234567890[]|/?><.,;:'": 1
}
4 changes: 2 additions & 2 deletions test/toml/valid/long-float.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"longpi": {"type": "float", "value": "3.141592653589793"},
"neglongpi": {"type": "float", "value": "-3.141592653589793"}
"longpi": 3.141592653589793,
"neglongpi": -3.141592653589793
}
4 changes: 2 additions & 2 deletions test/toml/valid/long-integer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"answer": {"type": "integer", "value": "9223372036854775807"},
"neganswer": {"type": "integer", "value": "-9223372036854775808"}
"answer": 9223372036854775807,
"neganswer": -9223372036854775808
}
35 changes: 7 additions & 28 deletions test/toml/valid/multiline-string.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
{
"multiline_empty_one": {
"type": "string",
"value": ""
},
"multiline_empty_two": {
"type": "string",
"value": ""
},
"multiline_empty_three": {
"type": "string",
"value": ""
},
"multiline_empty_four": {
"type": "string",
"value": ""
},
"equivalent_one": {
"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."
},
"equivalent_three": {
"type": "string",
"value": "The quick brown fox jumps over the lazy dog."
}
"multiline_empty_one": "",
"multiline_empty_two": "",
"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."
}
15 changes: 3 additions & 12 deletions test/toml/valid/raw-multiline-string.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{
"oneline": {
"type": "string",
"value": "This string has a ' quote character."
},
"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": "This string has a ' quote character.",
"firstnl": "This string has a ' quote character.",
"multiline": "This string\nhas ' a quote character\nand more than\none newline\nin it."
}
35 changes: 7 additions & 28 deletions test/toml/valid/raw-string.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
{
"backspace": {
"type": "string",
"value": "This string has a \\b backspace character."
},
"tab": {
"type": "string",
"value": "This string has a \\t tab character."
},
"newline": {
"type": "string",
"value": "This string has a \\n new line character."
},
"formfeed": {
"type": "string",
"value": "This string has a \\f form feed character."
},
"carriage": {
"type": "string",
"value": "This string has a \\r carriage return character."
},
"slash": {
"type": "string",
"value": "This string has a \\/ slash character."
},
"backslash": {
"type": "string",
"value": "This string has a \\\\ backslash character."
}
"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."
}
5 changes: 1 addition & 4 deletions test/toml/valid/string-empty.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"answer": {
"type": "string",
"value": ""
}
"answer": ""
}
Loading

0 comments on commit 69f2e95

Please sign in to comment.