From c0fc59b088282bb25e9cc37fe6a989a2b76435dc Mon Sep 17 00:00:00 2001 From: Marcel van Lohuizen Date: Tue, 25 Mar 2025 12:06:13 +0100 Subject: [PATCH] encoding/jsonschema: clean up TestExtX Schema was printed twice. Also, print full list of errors. Signed-off-by: Marcel van Lohuizen Change-Id: I782e90cea46d92bcf340b40804ea6393de8da9a3 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212146 Reviewed-by: Matthew Sackman TryBot-Result: CUEcueckoo Unity-Result: CUE porcuepine --- encoding/jsonschema/debug_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/encoding/jsonschema/debug_test.go b/encoding/jsonschema/debug_test.go index bfded4bb7..ed411e95c 100644 --- a/encoding/jsonschema/debug_test.go +++ b/encoding/jsonschema/debug_test.go @@ -111,8 +111,7 @@ func TestExtX(t *testing.T) { qt.Assert(t, qt.IsNil(extractErr)) b, err := format.Node(schemaAST, format.Simplify()) qt.Assert(t, qt.IsNil(err)) - t.Logf("extracted schema: %v", string(b)) - schema := string(b) + t.Logf("SCHEMA: %v", string(b)) schemaValue := ctx.CompileBytes(b, cue.Filename("generated.cue")) if err := schemaValue.Err(); err != nil { t.Fatalf("cannot compile resulting schema: %v", errors.Details(err, nil)) @@ -126,10 +125,9 @@ func TestExtX(t *testing.T) { qt.Assert(t, qt.IsNil(err), qt.Commentf("test data: %q; details: %v", testData, errors.Details(err, nil))) instValue := ctx.BuildExpr(instAST) + t.Log("VALUE", instValue) qt.Assert(t, qt.IsNil(instValue.Err())) err = instValue.Unify(schemaValue).Validate(cue.Concrete(true)) - t.Error(err) - t.Log("VALUE", instValue) - t.Log("SCHEMA", schema) + t.Error(errors.Details(err, nil)) } -- 2.51.2