You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,3 +90,36 @@ By running `generate.sh` (which is equivalent to running `deno task generate-tes
90
90
*[textualized](src/languages/testLanguage.txt), and
91
91
*[rendered as PlantUML diagram](src/languages/testLanguage.puml).
92
92
93
+
94
+
## Test data for serialization format validators
95
+
96
+
The [`testset/`](testset) directory contains test data that can be used to test validators that validate whether serialization chunks (JSON files) conform to the serialization format specification.
97
+
The subdirectory [`withoutLanguage/`](testset/withoutLanguage) pertains to serialization chunks that are to be validated *without* a registered language.
98
+
The subdirectory [`withLanguage/`](testset/withLanguage) pertains to serialization chunks that are to be validated *against* a registered language — m.n. the one serialized as [`myLang.language.json`](testset/withLanguage/myLang.language.json).
99
+
Either subdirectories contain two subdirectories named `valid` and `invalid`.
100
+
Each (nested) subdirectory under `invalid` contains a `__TestExpectation.json` file which specifies which chunk fails validation, and if so, with which error type.
101
+
The format of the `__TestExpectation.json` files is as follows:
102
+
103
+
```json lines
104
+
{
105
+
"errors": [
106
+
{
107
+
"file": "<file next to __TestExpectation.json>",
108
+
"error": "<error type>"
109
+
},
110
+
...
111
+
]
112
+
}
113
+
```
114
+
115
+
Consider the following example of a member of the `errors` array:
116
+
117
+
```json
118
+
{
119
+
"file": "empty.json",
120
+
"error": "PropertyValueIncorrect"
121
+
}
122
+
```
123
+
124
+
This means that validating the `empty.json` file is expected to produce an error of type `PropertyValueIncorrect` (and that it’s the first one produced).
0 commit comments