From ebfdfc969e6c03c9fa0788995d0079c6c68830ad Mon Sep 17 00:00:00 2001 From: trobro Date: Sat, 14 Oct 2023 16:56:36 +0200 Subject: [PATCH] tests 1 --- assets/comments2_result.hjson | 1 + assets/comments2_result.json | 1 + assets/comments2_test.hjson | 3 +++ assets/comments3_result.hjson | 1 + assets/comments3_result.json | 1 + assets/comments3_test.hjson | 3 +++ assets/comments4_result.hjson | 23 ++++++++++++++++ assets/comments4_result.json | 23 ++++++++++++++++ assets/comments4_test.hjson | 51 +++++++++++++++++++++++++++++++++++ assets/comments5_result.hjson | 25 +++++++++++++++++ assets/comments5_result.json | 23 ++++++++++++++++ assets/comments5_test.hjson | 51 +++++++++++++++++++++++++++++++++++ assets/comments6_result.hjson | 1 + assets/comments6_result.json | 1 + assets/comments6_test.hjson | 3 +++ assets/comments7_result.hjson | 8 ++++++ assets/comments7_result.json | 7 +++++ assets/comments7_test.hjson | 8 ++++++ assets/testlist.txt | 8 +++++- 19 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 assets/comments2_result.hjson create mode 100644 assets/comments2_result.json create mode 100644 assets/comments2_test.hjson create mode 100644 assets/comments3_result.hjson create mode 100644 assets/comments3_result.json create mode 100644 assets/comments3_test.hjson create mode 100644 assets/comments4_result.hjson create mode 100644 assets/comments4_result.json create mode 100644 assets/comments4_test.hjson create mode 100644 assets/comments5_result.hjson create mode 100644 assets/comments5_result.json create mode 100644 assets/comments5_test.hjson create mode 100644 assets/comments6_result.hjson create mode 100644 assets/comments6_result.json create mode 100644 assets/comments6_test.hjson create mode 100644 assets/comments7_result.hjson create mode 100644 assets/comments7_result.json create mode 100644 assets/comments7_test.hjson diff --git a/assets/comments2_result.hjson b/assets/comments2_result.hjson new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/assets/comments2_result.hjson @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/assets/comments2_result.json b/assets/comments2_result.json new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/assets/comments2_result.json @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/assets/comments2_test.hjson b/assets/comments2_test.hjson new file mode 100644 index 0000000..c573d16 --- /dev/null +++ b/assets/comments2_test.hjson @@ -0,0 +1,3 @@ +// before +/* before2 */ 3 // after1 +// after2 \ No newline at end of file diff --git a/assets/comments3_result.hjson b/assets/comments3_result.hjson new file mode 100644 index 0000000..df7c1b4 --- /dev/null +++ b/assets/comments3_result.hjson @@ -0,0 +1 @@ +a string value // still part of the string \ No newline at end of file diff --git a/assets/comments3_result.json b/assets/comments3_result.json new file mode 100644 index 0000000..c8fc8ca --- /dev/null +++ b/assets/comments3_result.json @@ -0,0 +1 @@ +"a string value // still part of the string" \ No newline at end of file diff --git a/assets/comments3_test.hjson b/assets/comments3_test.hjson new file mode 100644 index 0000000..c09eb46 --- /dev/null +++ b/assets/comments3_test.hjson @@ -0,0 +1,3 @@ +// before +/* before2 */ a string value // still part of the string +// after2 \ No newline at end of file diff --git a/assets/comments4_result.hjson b/assets/comments4_result.hjson new file mode 100644 index 0000000..cf72d01 --- /dev/null +++ b/assets/comments4_result.hjson @@ -0,0 +1,23 @@ +[ + a string value // still part of the string + a string value + {} + {} + {} + [] + {} + { + val5a: 1 + val5b: 2 + } + [] + [] + [] + [] + [ + 1 + 2 + ] + 3 + 4 +] \ No newline at end of file diff --git a/assets/comments4_result.json b/assets/comments4_result.json new file mode 100644 index 0000000..43a35b7 --- /dev/null +++ b/assets/comments4_result.json @@ -0,0 +1,23 @@ +[ + "a string value // still part of the string", + "a string value", + {}, + {}, + {}, + [], + {}, + { + "val5a": 1, + "val5b": 2 + }, + [], + [], + [], + [], + [ + 1, + 2 + ], + 3, + 4 +] \ No newline at end of file diff --git a/assets/comments4_test.hjson b/assets/comments4_test.hjson new file mode 100644 index 0000000..c6a884e --- /dev/null +++ b/assets/comments4_test.hjson @@ -0,0 +1,51 @@ +// before +/* before2 */ [ #before1 + /*key1keycm*/a string value // still part of the string + /* key2keycm */ "a string value" // not part of the string + // map1before + /* map1key */ + {}//map2after + {} + { + // map3 inner comment + } + [] + // map4before + /*map4key*/{ + /* map4inner */ + } // map4after + //map5before + /*map5key*/ { + //map5ab4 + val5a: /* map5akey */ 1, // map5aAfter + val5b: 2 /* map5bb4comma */ , #map5bAfter + #map5extra + } /* map5after */ + // vec1bbefore + /* vec1bkey */ + []//vec1bafter + [] + [ + // vec3 inner comment + ] + // vec4before + /*vec4key*/[ + /* vec4inner */ + ] // vec4after + //vec5before + /*vec5key*/ [ + //vec5ab4 + 1, // vec5aAfter + 2 /* vec5bb4comma */ , #vec5bAfter + #vec5extra + ] /* map5after */ + // before3 + + 3 # after3 + # before4 + /*before4b*/4/*after4*/ + #after4b +] +// after2 + +/* after3 */ \ No newline at end of file diff --git a/assets/comments5_result.hjson b/assets/comments5_result.hjson new file mode 100644 index 0000000..81409f5 --- /dev/null +++ b/assets/comments5_result.hjson @@ -0,0 +1,25 @@ +{ + key1: a string value // still part of the string + key2: a string value + map1: {} + map2: {} + map3: {} + vec1: [] + map4: {} + map5: + { + val5a: 1 + val5b: 2 + } + vec1b: [] + vec2: [] + vec3: [] + vec4: [] + vec5: + [ + 1 + 2 + ] + key3: 3 + key4: 4 +} \ No newline at end of file diff --git a/assets/comments5_result.json b/assets/comments5_result.json new file mode 100644 index 0000000..50b7915 --- /dev/null +++ b/assets/comments5_result.json @@ -0,0 +1,23 @@ +{ + "key1": "a string value // still part of the string", + "key2": "a string value", + "map1": {}, + "map2": {}, + "map3": {}, + "vec1": [], + "map4": {}, + "map5": { + "val5a": 1, + "val5b": 2 + }, + "vec1b": [], + "vec2": [], + "vec3": [], + "vec4": [], + "vec5": [ + 1, + 2 + ], + "key3": 3, + "key4": 4 +} \ No newline at end of file diff --git a/assets/comments5_test.hjson b/assets/comments5_test.hjson new file mode 100644 index 0000000..9d983fb --- /dev/null +++ b/assets/comments5_test.hjson @@ -0,0 +1,51 @@ +// before +/* before2 */ { #before1 + key1:/*key1keycm*/a string value // still part of the string + key2: /* key2keycm */ "a string value" // not part of the string + // map1before + map1: /* map1key */ + {}//map2after + map2: {} + map3: { + // map3 inner comment + } + vec1: [] + // map4before + map4:/*map4key*/{ + /* map4inner */ + } // map4after + //map5before + map5: /*map5key*/ { + //map5ab4 + val5a: /* map5akey */ 1, // map5aAfter + val5b: 2 /* map5bb4comma */ , #map5bAfter + #map5extra + } /* map5after */ + // vec1bbefore + vec1b: /* vec1bkey */ + []//vec1bafter + vec2: [] + vec3: [ + // vec3 inner comment + ] + // vec4before + vec4:/*vec4key*/[ + /* vec4inner */ + ] // vec4after + //vec5before + vec5: /*vec5key*/ [ + //vec5ab4 + 1, // vec5aAfter + 2 /* vec5bb4comma */ , #vec5bAfter + #vec5extra + ] /* map5after */ + // before3 + + key3 : 3 # after3 + # before4 + /*before4b*/key4:4/*after4*/ + #after4b +} +// after2 + +/* after3 */ \ No newline at end of file diff --git a/assets/comments6_result.hjson b/assets/comments6_result.hjson new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/assets/comments6_result.hjson @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/assets/comments6_result.json b/assets/comments6_result.json new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/assets/comments6_result.json @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/assets/comments6_test.hjson b/assets/comments6_test.hjson new file mode 100644 index 0000000..8a9c16f --- /dev/null +++ b/assets/comments6_test.hjson @@ -0,0 +1,3 @@ +// before +/* before2 */ 3 // after1 +// after2 \ No newline at end of file diff --git a/assets/comments7_result.hjson b/assets/comments7_result.hjson new file mode 100644 index 0000000..cda8102 --- /dev/null +++ b/assets/comments7_result.hjson @@ -0,0 +1,8 @@ +{ + b: + { + sub1: 3 + sub2: 4 + } + a: 2 +} \ No newline at end of file diff --git a/assets/comments7_result.json b/assets/comments7_result.json new file mode 100644 index 0000000..c621dab --- /dev/null +++ b/assets/comments7_result.json @@ -0,0 +1,7 @@ +{ + "b": { + "sub1": 3, + "sub2": 4 + }, + "a": 2 +} \ No newline at end of file diff --git a/assets/comments7_test.hjson b/assets/comments7_test.hjson new file mode 100644 index 0000000..1bb0342 --- /dev/null +++ b/assets/comments7_test.hjson @@ -0,0 +1,8 @@ +# comment before +b: /* key comment */ { + sub1: 3 # comment after + sub2: 4 # comment more after +} # cm after obj +// Comment B4 +a: 2 +/* Last comment */ diff --git a/assets/testlist.txt b/assets/testlist.txt index 07cdf03..8b143af 100644 --- a/assets/testlist.txt +++ b/assets/testlist.txt @@ -1,6 +1,12 @@ -charset_test.hjson charset2_test.hjson +charset_test.hjson comments_test.hjson +comments2_test.hjson +comments3_test.hjson +comments4_test.hjson +comments5_test.hjson +comments6_test.hjson +comments7_test.hjson empty_test.hjson failCharset1_test.hjson failJSON02_test.json