From 8a207a83fe21da6e498697b9a0ec81932f5208e6 Mon Sep 17 00:00:00 2001 From: Tae-il Lim Date: Sat, 2 Apr 2016 17:15:59 +0900 Subject: Update integration tests to BurntSushi/toml-test@2f1c20de60bc9de743bdb8c7d2e79172fb28e6f8 --- tests/valid/arrays-hetergeneous.json | 4 ++-- tests/valid/arrays-hetergeneous.toml | 2 +- tests/valid/arrays.json | 6 +++--- tests/valid/arrays.toml | 3 +-- tests/valid/key-space.json | 3 +++ tests/valid/key-space.toml | 1 + tests/valid/multiline-string.json | 30 ++++++++++++++++++++++++++++++ tests/valid/multiline-string.toml | 23 +++++++++++++++++++++++ tests/valid/raw-multiline-string.json | 14 ++++++++++++++ tests/valid/raw-multiline-string.toml | 9 +++++++++ tests/valid/raw-string.json | 30 ++++++++++++++++++++++++++++++ tests/valid/raw-string.toml | 7 +++++++ tests/valid/string-escapes.json | 16 ++++++++++++++++ tests/valid/string-escapes.toml | 4 ++++ tests/valid/unicode-escape.json | 3 ++- tests/valid/unicode-escape.toml | 3 ++- 16 files changed, 148 insertions(+), 10 deletions(-) create mode 100644 tests/valid/key-space.json create mode 100644 tests/valid/key-space.toml create mode 100644 tests/valid/multiline-string.json create mode 100644 tests/valid/multiline-string.toml create mode 100644 tests/valid/raw-multiline-string.json create mode 100644 tests/valid/raw-multiline-string.toml create mode 100644 tests/valid/raw-string.json create mode 100644 tests/valid/raw-string.toml (limited to 'tests/valid') diff --git a/tests/valid/arrays-hetergeneous.json b/tests/valid/arrays-hetergeneous.json index e703739..478fa5c 100644 --- a/tests/valid/arrays-hetergeneous.json +++ b/tests/valid/arrays-hetergeneous.json @@ -11,8 +11,8 @@ {"type": "string", "value": "b"} ]}, {"type": "array", "value": [ - {"type": "float", "value": "1.0"}, - {"type": "float", "value": "2.0"} + {"type": "float", "value": "1.1"}, + {"type": "float", "value": "2.1"} ]} ] } diff --git a/tests/valid/arrays-hetergeneous.toml b/tests/valid/arrays-hetergeneous.toml index 91fcbdf..a246fcf 100644 --- a/tests/valid/arrays-hetergeneous.toml +++ b/tests/valid/arrays-hetergeneous.toml @@ -1 +1 @@ -mixed = [[1, 2], ["a", "b"], [1.0, 2.0]] +mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/tests/valid/arrays.json b/tests/valid/arrays.json index 4d16d8a..58aedbc 100644 --- a/tests/valid/arrays.json +++ b/tests/valid/arrays.json @@ -10,9 +10,9 @@ "floats": { "type": "array", "value": [ - {"type": "float", "value": "1.0"}, - {"type": "float", "value": "2.0"}, - {"type": "float", "value": "3.0"} + {"type": "float", "value": "1.1"}, + {"type": "float", "value": "2.1"}, + {"type": "float", "value": "3.1"} ] }, "strings": { diff --git a/tests/valid/arrays.toml b/tests/valid/arrays.toml index 6d6440d..c435f57 100644 --- a/tests/valid/arrays.toml +++ b/tests/valid/arrays.toml @@ -1,9 +1,8 @@ ints = [1, 2, 3] -floats = [1.0, 2.0, 3.0] +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, ] - diff --git a/tests/valid/key-space.json b/tests/valid/key-space.json new file mode 100644 index 0000000..9d1f769 --- /dev/null +++ b/tests/valid/key-space.json @@ -0,0 +1,3 @@ +{ + "a b": {"type": "integer", "value": "1"} +} diff --git a/tests/valid/key-space.toml b/tests/valid/key-space.toml new file mode 100644 index 0000000..f4f36c4 --- /dev/null +++ b/tests/valid/key-space.toml @@ -0,0 +1 @@ +"a b" = 1 diff --git a/tests/valid/multiline-string.json b/tests/valid/multiline-string.json new file mode 100644 index 0000000..075bf50 --- /dev/null +++ b/tests/valid/multiline-string.json @@ -0,0 +1,30 @@ +{ + "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." + } +} diff --git a/tests/valid/multiline-string.toml b/tests/valid/multiline-string.toml new file mode 100644 index 0000000..15b1143 --- /dev/null +++ b/tests/valid/multiline-string.toml @@ -0,0 +1,23 @@ +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.\ + """ diff --git a/tests/valid/raw-multiline-string.json b/tests/valid/raw-multiline-string.json new file mode 100644 index 0000000..b43cce5 --- /dev/null +++ b/tests/valid/raw-multiline-string.json @@ -0,0 +1,14 @@ +{ + "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." + } +} diff --git a/tests/valid/raw-multiline-string.toml b/tests/valid/raw-multiline-string.toml new file mode 100644 index 0000000..8094c03 --- /dev/null +++ b/tests/valid/raw-multiline-string.toml @@ -0,0 +1,9 @@ +oneline = '''This string has a ' quote character.''' +firstnl = ''' +This string has a ' quote character.''' +multiline = ''' +This string +has ' a quote character +and more than +one newline +in it.''' diff --git a/tests/valid/raw-string.json b/tests/valid/raw-string.json new file mode 100644 index 0000000..693ab9b --- /dev/null +++ b/tests/valid/raw-string.json @@ -0,0 +1,30 @@ +{ + "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." + } +} diff --git a/tests/valid/raw-string.toml b/tests/valid/raw-string.toml new file mode 100644 index 0000000..92acd25 --- /dev/null +++ b/tests/valid/raw-string.toml @@ -0,0 +1,7 @@ +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.' diff --git a/tests/valid/string-escapes.json b/tests/valid/string-escapes.json index ca71d30..62dac51 100644 --- a/tests/valid/string-escapes.json +++ b/tests/valid/string-escapes.json @@ -30,5 +30,21 @@ "backslash": { "type": "string", "value": "This string has a \u005C backslash character." + }, + "notunicode1": { + "type": "string", + "value": "This string does not have a unicode \\u escape." + }, + "notunicode2": { + "type": "string", + "value": "This string does not have a unicode \u005Cu escape." + }, + "notunicode3": { + "type": "string", + "value": "This string does not have a unicode \\u0075 escape." + }, + "notunicode4": { + "type": "string", + "value": "This string does not have a unicode \\\u0075 escape." } } diff --git a/tests/valid/string-escapes.toml b/tests/valid/string-escapes.toml index 9f9a8c0..c5d4954 100644 --- a/tests/valid/string-escapes.toml +++ b/tests/valid/string-escapes.toml @@ -6,3 +6,7 @@ carriage = "This string has a \r carriage return character." quote = "This string has a \" quote character." slash = "This string has a / slash character." backslash = "This string has a \\ backslash character." +notunicode1 = "This string does not have a unicode \\u escape." +notunicode2 = "This string does not have a unicode \u005Cu escape." +notunicode3 = "This string does not have a unicode \\u0075 escape." +notunicode4 = "This string does not have a unicode \\\u0075 escape." diff --git a/tests/valid/unicode-escape.json b/tests/valid/unicode-escape.json index deda62c..216f8f7 100644 --- a/tests/valid/unicode-escape.json +++ b/tests/valid/unicode-escape.json @@ -1,3 +1,4 @@ { - "answer": {"type": "string", "value": "\u03B4"} + "answer4": {"type": "string", "value": "\u03B4"}, + "answer8": {"type": "string", "value": "\u03B4"} } diff --git a/tests/valid/unicode-escape.toml b/tests/valid/unicode-escape.toml index 057ce15..82faecb 100644 --- a/tests/valid/unicode-escape.toml +++ b/tests/valid/unicode-escape.toml @@ -1 +1,2 @@ -answer = "\u03B4" +answer4 = "\u03B4" +answer8 = "\U000003B4" -- cgit v1.2.3