Skip to content

Commit 5409884

Browse files
committed
encoding/jsonschema: add docs about test file conventions
This makes it clearer how to write jsonschema test cases. It was intended to be part of https://cuelang.org/cl/1199743 but was accidentally omitted from that CL. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I2e5f92526ace4949551b0976cdf9c3d9313e0502 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200066 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 3138301 commit 5409884

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

encoding/jsonschema/decode_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ import (
4545
// JSON schema to CUE and compares it against the output.
4646
//
4747
// Set CUE_UPDATE=1 to update test files with the corresponding output.
48+
//
49+
// Each test extracts the JSON Schema from a schema file (either
50+
// schema.json or schema.yaml) and writes the result to
51+
// out/decode/extract.
52+
//
53+
// If there are any files in the "test" directory in the txtar, each one
54+
// is extracted and validated against the extracted schema. If the file
55+
// name starts with "err-" it is expected to fail, otherwise it is
56+
// expected to succeed.
57+
//
58+
// The #noverify tag in the txtar header causes verification and
59+
// instance tests to be skipped.
60+
//
61+
// The #openapi tag in the txtar header enables OpenAPI extraction mode.
4862
func TestDecode(t *testing.T) {
4963
test := cuetxtar.TxTarTest{
5064
Root: "./testdata",

0 commit comments

Comments
 (0)