From 2c293cc0ac6678253c6af8101ba93866785f64c0 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 21 Jun 2020 11:12:26 -0500 Subject: WIP for refactoring tests --- tests/templates/ini/default.ini | 7 +++++++ tests/templates/json/default.json | 13 +++++++++++++ tests/templates/json/glossary.json | 35 +++++++++++++++++++++++++++++++++++ tests/templates/json/invalid.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 tests/templates/ini/default.ini create mode 100644 tests/templates/json/default.json create mode 100644 tests/templates/json/glossary.json create mode 100644 tests/templates/json/invalid.json (limited to 'tests/templates') diff --git a/tests/templates/ini/default.ini b/tests/templates/ini/default.ini new file mode 100644 index 0000000..4f711db --- /dev/null +++ b/tests/templates/ini/default.ini @@ -0,0 +1,7 @@ +[header_one] +number_key = 0 + +[header_two] +str_key = "string" +list_key = [1, 2, 3] + diff --git a/tests/templates/json/default.json b/tests/templates/json/default.json new file mode 100644 index 0000000..83d9b1e --- /dev/null +++ b/tests/templates/json/default.json @@ -0,0 +1,13 @@ +{ + "header_one": { + "number_key": 0 + }, + "header_two": { + "str_key": "string", + "list_key": [ + 1, + 2, + 3 + ] + } +} \ No newline at end of file diff --git a/tests/templates/json/glossary.json b/tests/templates/json/glossary.json new file mode 100644 index 0000000..189d8a4 --- /dev/null +++ b/tests/templates/json/glossary.json @@ -0,0 +1,35 @@ +{ + "glossary": { + "title": "str_value", + "GlossDiv": { + "title": "5", + "GlossList": { + "GlossEntry": { + "ID": "false", + "SortAs": "SGML", + "GlossTerm": "Standard Generalized Markup Language", + "Acronym": "SGML", + "Abbrev": "ISO 8879:1986", + "GlossDef": { + "para": "A meta-markup language, used to create markup languages such as DocBook.", + "GlossSeeAlso": ["GML", "XML"] + }, + "GlossSee": "5.5" + } + } + }, + "dict": { + "key": "str_value", + "str_number": "5" + }, + "dict_within_dict": { + "str_number": "16", + "another_dict": { + "str_bool": "false", + "list_of_values": [ + "5", "false", "trUe" + ] + } + } + } +} \ No newline at end of file diff --git a/tests/templates/json/invalid.json b/tests/templates/json/invalid.json new file mode 100644 index 0000000..8e12c39 --- /dev/null +++ b/tests/templates/json/invalid.json @@ -0,0 +1 @@ +{'test': } \ No newline at end of file -- cgit v1.2.3 From 3fa782f5b5e3bd4445a5db63c0fce5aaac2d4ac3 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 20 Jul 2020 22:55:40 -0500 Subject: Add work in progress tests --- tests/templates/toml/default.toml | 6 ++++++ tests/templates/yaml/default.yaml | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/templates/toml/default.toml create mode 100644 tests/templates/yaml/default.yaml (limited to 'tests/templates') diff --git a/tests/templates/toml/default.toml b/tests/templates/toml/default.toml new file mode 100644 index 0000000..326de33 --- /dev/null +++ b/tests/templates/toml/default.toml @@ -0,0 +1,6 @@ +[header_one] +number_key = 0 + +[header_two] +str_key = "string" +list_key = [1, 2, 3] diff --git a/tests/templates/yaml/default.yaml b/tests/templates/yaml/default.yaml new file mode 100644 index 0000000..095ada8 --- /dev/null +++ b/tests/templates/yaml/default.yaml @@ -0,0 +1,6 @@ +header_one: + number_key: 0 + +header_two: + str_key: "string" + list_key: [1, 2, 3] \ No newline at end of file -- cgit v1.2.3 From df90fd036d004c79f340e4c1d01b2171add80047 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 29 Jul 2020 21:27:18 -0500 Subject: Fix tests for recent changes --- tests/templates/json/glossary.json | 4 +--- tests/templates/toml/default.toml | 1 + tests/templates/yaml/default.yaml | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/templates') diff --git a/tests/templates/json/glossary.json b/tests/templates/json/glossary.json index 189d8a4..d27eb8d 100644 --- a/tests/templates/json/glossary.json +++ b/tests/templates/json/glossary.json @@ -26,9 +26,7 @@ "str_number": "16", "another_dict": { "str_bool": "false", - "list_of_values": [ - "5", "false", "trUe" - ] + "list_of_values": ["5", "false", "trUe"] } } } diff --git a/tests/templates/toml/default.toml b/tests/templates/toml/default.toml index 326de33..e0437cf 100644 --- a/tests/templates/toml/default.toml +++ b/tests/templates/toml/default.toml @@ -2,5 +2,6 @@ number_key = 0 [header_two] +# preserves comments str_key = "string" list_key = [1, 2, 3] diff --git a/tests/templates/yaml/default.yaml b/tests/templates/yaml/default.yaml index 095ada8..8c7c63e 100644 --- a/tests/templates/yaml/default.yaml +++ b/tests/templates/yaml/default.yaml @@ -2,5 +2,6 @@ header_one: number_key: 0 header_two: - str_key: "string" - list_key: [1, 2, 3] \ No newline at end of file + # preserves comments + list_key: [1, 2, 3] + str_key: string -- cgit v1.2.3 From c73710bd173702e9d0e1cf005333274c23418574 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 7 Aug 2020 19:39:30 -0500 Subject: Add invalid templates --- tests/templates/ini/invalid.ini | 2 ++ tests/templates/toml/invalid.toml | 1 + tests/templates/yaml/invalid.yaml | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 tests/templates/ini/invalid.ini create mode 100644 tests/templates/toml/invalid.toml create mode 100644 tests/templates/yaml/invalid.yaml (limited to 'tests/templates') diff --git a/tests/templates/ini/invalid.ini b/tests/templates/ini/invalid.ini new file mode 100644 index 0000000..c2a81db --- /dev/null +++ b/tests/templates/ini/invalid.ini @@ -0,0 +1,2 @@ +[[[[[]]]]] +i am a key \ No newline at end of file diff --git a/tests/templates/toml/invalid.toml b/tests/templates/toml/invalid.toml new file mode 100644 index 0000000..d1b18e3 --- /dev/null +++ b/tests/templates/toml/invalid.toml @@ -0,0 +1 @@ +[[[[[[notvalidtoml]]]]]] \ No newline at end of file diff --git a/tests/templates/yaml/invalid.yaml b/tests/templates/yaml/invalid.yaml new file mode 100644 index 0000000..cf2a4ff --- /dev/null +++ b/tests/templates/yaml/invalid.yaml @@ -0,0 +1,6 @@ +invalid-yaml: +yar: +i: +am: +invalid: +boo \ No newline at end of file -- cgit v1.2.3 From 2ef17a5a002b3c304076339619f208ee01e36f48 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 7 Aug 2020 20:14:44 -0500 Subject: Add all_strings template files --- tests/templates/ini/all_strings.ini | 7 +++++++ tests/templates/json/all_strings.json | 9 +++++++++ tests/templates/json/glossary.json | 33 --------------------------------- tests/templates/toml/all_strings.toml | 6 ++++++ tests/templates/yaml/all_strings.yaml | 6 ++++++ 5 files changed, 28 insertions(+), 33 deletions(-) create mode 100644 tests/templates/ini/all_strings.ini create mode 100644 tests/templates/json/all_strings.json delete mode 100644 tests/templates/json/glossary.json create mode 100644 tests/templates/toml/all_strings.toml create mode 100644 tests/templates/yaml/all_strings.yaml (limited to 'tests/templates') diff --git a/tests/templates/ini/all_strings.ini b/tests/templates/ini/all_strings.ini new file mode 100644 index 0000000..9ac0ecf --- /dev/null +++ b/tests/templates/ini/all_strings.ini @@ -0,0 +1,7 @@ +[header] +list = [] +dict = {} +num = 5 +bool = false +float = 5.5 + diff --git a/tests/templates/json/all_strings.json b/tests/templates/json/all_strings.json new file mode 100644 index 0000000..18ada7b --- /dev/null +++ b/tests/templates/json/all_strings.json @@ -0,0 +1,9 @@ +{ + "header": { + "list": "[]", + "dict": "{}", + "num": "5", + "bool": "false", + "float": "5.5" + } +} \ No newline at end of file diff --git a/tests/templates/json/glossary.json b/tests/templates/json/glossary.json deleted file mode 100644 index d27eb8d..0000000 --- a/tests/templates/json/glossary.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "glossary": { - "title": "str_value", - "GlossDiv": { - "title": "5", - "GlossList": { - "GlossEntry": { - "ID": "false", - "SortAs": "SGML", - "GlossTerm": "Standard Generalized Markup Language", - "Acronym": "SGML", - "Abbrev": "ISO 8879:1986", - "GlossDef": { - "para": "A meta-markup language, used to create markup languages such as DocBook.", - "GlossSeeAlso": ["GML", "XML"] - }, - "GlossSee": "5.5" - } - } - }, - "dict": { - "key": "str_value", - "str_number": "5" - }, - "dict_within_dict": { - "str_number": "16", - "another_dict": { - "str_bool": "false", - "list_of_values": ["5", "false", "trUe"] - } - } - } -} \ No newline at end of file diff --git a/tests/templates/toml/all_strings.toml b/tests/templates/toml/all_strings.toml new file mode 100644 index 0000000..8fda0d8 --- /dev/null +++ b/tests/templates/toml/all_strings.toml @@ -0,0 +1,6 @@ +[header] +list = "[]" +dict = "{}" +num = "5" +bool = "false" +float = "5.5" \ No newline at end of file diff --git a/tests/templates/yaml/all_strings.yaml b/tests/templates/yaml/all_strings.yaml new file mode 100644 index 0000000..1c94b37 --- /dev/null +++ b/tests/templates/yaml/all_strings.yaml @@ -0,0 +1,6 @@ +header: + list: "[]" + dict: "{}" + num: "5" + bool: "false" + float: "5.5" \ No newline at end of file -- cgit v1.2.3