File tree 3 files changed +35
-2
lines changed 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change
1
+ language : bash
2
+
3
+ sudo : false
4
+
5
+ addons :
6
+ apt :
7
+ packages :
8
+ - jq
9
+
10
+ script :
11
+ - bin/jsonlint
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Please see the [contributing guide](https://github.com/exercism/x-api/blob/maste
9
9
10
10
## Test Data Format
11
11
12
- Each problem can have a file & lt ; problem>.json containing standard test data.
12
+ Each problem can have a file < problem >.json containing standard test data.
13
13
This data can be incoporated into test programs manually or extracted by a
14
14
program. The file contains a single JSON object with a key for documentation
15
15
and keys for various tests that may be meaningful for a problem.
@@ -24,7 +24,18 @@ Each test uses a key name representative of the test and an object as the
24
24
value. This object has two keys, "Description" and "Cases". Description has
25
25
a list of strings as its value. Cases has a list of objects as its value.
26
26
Each case object represents a separate test case. A case object should have
27
- a description field and fields for inputs and outputs. A test case description should be a short phrase, suitable to be included in an error message.
27
+ a description field and fields for inputs and outputs. A test case description
28
+ should be a short phrase, suitable to be included in an error message.
29
+
30
+ ## Automated Tests
31
+
32
+ The only thing that we're testing at the moment, is whether or not shared test data
33
+ is valid json.
34
+
35
+ If you want to run this before you commit, you will need to install
36
+ [ jq] ( https://stedolan.github.io/jq/download/ ) . Then run the script with:
37
+
38
+ bin/jsonlint
28
39
29
40
## License
30
41
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ STATUS=0
4
+ for f in $( ls * .json) ; do
5
+ cat $f | jq . > /dev/null 2>&1
6
+ if [ $? != 0 ]; then
7
+ echo " Invalid json: $f "
8
+ STATUS=1
9
+ fi
10
+ done
11
+ exit $STATUS
You can’t perform that action at this time.
0 commit comments