From c8193da3d0337f3611ffee31fe7f442b8847d073 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 7 Oct 2026 23:24:32 +0200 Subject: [PATCH] Test a weight of 0 drawn against nothing naming the drop, and null alone on stdin naming jq --- cmd/fejkdata/main_test.go | 4 ++-- spellings_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/fejkdata/main_test.go b/cmd/fejkdata/main_test.go index 9041765..e93490b 100644 --- a/cmd/fejkdata/main_test.go +++ b/cmd/fejkdata/main_test.go @@ -495,8 +495,8 @@ func TestRunTemplateMisuse(t *testing.T) { "42": "number", "42\n": "number", "true\n": "boolean", - "null\n": `write ""`, - " null ": `write ""`, + "null\n": "jq", + " null ": "jq", "{//sv_SE.person}": "write {/sv_SE.person}", } { code, out, errb := runOut(stdin, "--seed", "1") diff --git a/spellings_test.go b/spellings_test.go index 0688243..d26b94b 100644 --- a/spellings_test.go +++ b/spellings_test.go @@ -36,6 +36,7 @@ func TestAWeightWithNothingToDrawAgainstIsRejected(t *testing.T) { `{"format":"a","weight":2}`, `{"format":"{x}","x":{"format":"a","weight":2}}`, `[{"format":"a","weight":2}]`, + `{"format":"a","weight":0}`, } { _, err := resolved(t, src) if err == nil || !strings.Contains(err.Error(), `drop "weight"`) || strings.Contains(err.Error(), "can never be a field") || strings.Contains(err.Error(), "only skews a choice's items") {