Skip to content

Commit f2c9eb1

Browse files
authored
test improvements (#32)
1 parent 7aaa80f commit f2c9eb1

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

tests/HJSONParserTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ private function runEach($name, $file, $isJson, $inputCr, $outputCr)
104104
}
105105
} catch (HJSONException $e) {
106106
if (!$shouldFail) {
107+
echo "\n$e\n";
107108
throw $e;
108109
}
109110
}

tests/assets/comments_test.hjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ styles
1111
# !
1212

1313
{
14-
# hjson style comment
14+
# hjson style comment åäö
1515
foo1: This is a string value. # part of the string
1616
foo2: "This is a string value." # a comment
1717

tests/assets/failJSON35_test.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
:0
3+
}

tests/assets/strings_result.hjson

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
last line
2929

3030
'''
31+
multiline4: ←→±≠Я
32+
multiline5: åäö
3133
foo1a: asdf\"'a\s\w
3234
foo1b: asdf\"'a\s\w
3335
foo1c: asdf\"'a\s\w
@@ -75,5 +77,6 @@
7577
one: "1"
7678
two: "2"
7779
minus: "-3"
80+
zero: "0"
7881
}
7982
}

tests/assets/strings_result.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"multiline1": "first line\n indented line\nlast line",
1313
"multiline2": "first line\n indented line\nlast line",
1414
"multiline3": "first line\n indented line\nlast line\n",
15+
"multiline4": "←→±≠Я",
16+
"multiline5": "åäö",
1517
"foo1a": "asdf\\\"'a\\s\\w",
1618
"foo1b": "asdf\\\"'a\\s\\w",
1719
"foo1c": "asdf\\\"'a\\s\\w",
@@ -54,6 +56,7 @@
5456
"null": "null",
5557
"one": "1",
5658
"two": "2",
57-
"minus": "-3"
59+
"minus": "-3",
60+
"zero": "0"
5861
}
5962
}

tests/assets/strings_test.hjson

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737

3838
''' # trailing lf
3939

40+
multiline4:
41+
'''
42+
←→±≠Я
43+
'''
44+
45+
multiline5:
46+
'''
47+
åäö
48+
'''
49+
4050
# escapes/no escape
4151

4252
foo1a: asdf\"'a\s\w
@@ -81,5 +91,6 @@
8191
one: "1"
8292
two: "2"
8393
minus: "-3"
94+
zero: "0"
8495
}
8596
}

0 commit comments

Comments
 (0)