Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better github testing #30

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
rust: [stable]
steps:
- uses: actions/checkout@v4
- run: cd hjson && cargo build
- run: cd hjson_cli && cargo build
- run: cd hjson_tests && cargo test
- run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cd hjson && cargo build --release
- run: cd hjson_cli && cargo build --release
- run: cargo test -- --nocapture
- run: cd hjson && cargo doc
2 changes: 1 addition & 1 deletion hjson/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! # What is Hjson?
//!
//! A configuration file format for humans. Relaxed syntax, fewer mistakes, more comments.
//! See https://hjson.github.io
//! See <https://hjson.github.io>
//!
//! Data types that can be encoded are JavaScript types (see the `serde_hjson:Value` enum for more
//! details):
Expand Down
2 changes: 1 addition & 1 deletion hjson_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ serde-hjson = { version = "*", path = "../hjson" }

[[test]]
name = "test"
path = "tests/test.rs"
path = "tests/test_hjson.rs"
2 changes: 1 addition & 1 deletion hjson_tests/assets/charset_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/charset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"ql-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
"js-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
"ml-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/comments_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
str3: 02 /* part of the string */
/key: value
key2: /value2
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/comments_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"str3": "02 /* part of the string */",
"/key": "value",
"key2": "/value2"
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/empty_result.hjson
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"": empty
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/empty_result.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"": "empty"
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON02_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Unclosed array"
["Unclosed array"
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON05_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["double extra comma",,]
["double extra comma",,]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON06_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ , "<-- missing value"]
[ , "<-- missing value"]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON07_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Comma after the close"],
["Comma after the close"],
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON08_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Extra close"]]
["Extra close"]]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON10_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Extra value after close": true} "misplaced quoted value"
{"Extra value after close": true} "misplaced quoted value"
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON11_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Illegal expression": 1 + 2}
{"Illegal expression": 1 + 2}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON12_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Illegal invocation": alert()}
{"Illegal invocation": alert()}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON13_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Numbers cannot have leading zeroes": 013}
{"Numbers cannot have leading zeroes": 013}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON14_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Numbers cannot be hex": 0x14}
{"Numbers cannot be hex": 0x14}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON15_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Illegal backslash escape: \x15"]
["Illegal backslash escape: \x15"]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON16_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[\naked]
[\naked]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON17_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Illegal backslash escape: \017"]
["Illegal backslash escape: \017"]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON19_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Missing colon" null}
{"Missing colon" null}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON20_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Double colon":: null}
{"Double colon":: null}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON21_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Comma instead of colon", null}
{"Comma instead of colon", null}
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON22_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Colon instead of comma": false]
["Colon instead of comma": false]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON23_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Bad value", truth]
["Bad value", truth]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON24_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
['single quote']
['single quote']
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON26_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["tab\ character\ in\ string\ "]
["tab\ character\ in\ string\ "]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON28_test.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
["line\
break"]
break"]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON29_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0e]
[0e]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON30_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0e+]
[0e+]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON31_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0e+-1]
[0e+-1]
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON32_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Comma instead if closing brace": true,
{"Comma instead if closing brace": true,
2 changes: 1 addition & 1 deletion hjson_tests/assets/failJSON33_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["mismatch"}
["mismatch"}
2 changes: 1 addition & 1 deletion hjson_tests/assets/kan_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
null null
x null
]
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/kan_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
"null null",
"x null"
]
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/keys_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
nl1: test
nl2: test
nl3: test
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/keys_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"nl1": "test",
"nl2": "test",
"nl3": "test"
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/oa_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
d: {}
}
[]
]
]
2 changes: 1 addition & 1 deletion hjson_tests/assets/oa_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"d": {}
},
[]
]
]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass1_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
2
2
rosebud
]
]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass1_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
2,
2,
"rosebud"
]
]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass1_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
0.1e1,
1e-1,
1e00,2e+00,2e-00
,"rosebud"]
,"rosebud"]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass2_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
]
]
]
]
]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass2_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
]
]
]
]
]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass2_test.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass3_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"The outermost value": must be an object or array.
"In this test": It is an object.
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass3_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"The outermost value": "must be an object or array.",
"In this test": "It is an object."
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass4_result.hjson
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
10
2 changes: 1 addition & 1 deletion hjson_tests/assets/pass4_result.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
10
2 changes: 1 addition & 1 deletion hjson_tests/assets/passSingle_result.hjson
Original file line number Diff line number Diff line change
@@ -1 +1 @@
allow quoteless strings
allow quoteless strings
2 changes: 1 addition & 1 deletion hjson_tests/assets/passSingle_result.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"allow quoteless strings"
"allow quoteless strings"
2 changes: 1 addition & 1 deletion hjson_tests/assets/passSingle_test.hjson
Original file line number Diff line number Diff line change
@@ -1 +1 @@
allow quoteless strings
allow quoteless strings
2 changes: 1 addition & 1 deletion hjson_tests/assets/root_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
host: 127.0.0.1
port: 555
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/root_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"host": "127.0.0.1",
"port": 555
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/stringify1_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
comment2: a//str
comment3: a/*str*/
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/stringify1_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"comment2": "a//str",
"comment3": "a/*str*/"
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/strings_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
two: "2"
minus: "-3"
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/strings_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"two": "2",
"minus": "-3"
}
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/trail_result.hjson
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
foo: 0 -- this string starts at 0 and ends at 1, preceding and trailing whitespace is ignored -- 1
}
}
2 changes: 1 addition & 1 deletion hjson_tests/assets/trail_result.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"foo": "0 -- this string starts at 0 and ends at 1, preceding and trailing whitespace is ignored -- 1"
}
}
Loading