From 48cadd6c4d82155b67a39e76a00f0c796ae8191e Mon Sep 17 00:00:00 2001 From: M Date: Fri, 28 Aug 2026 00:39:47 +0200 Subject: [PATCH] Tests that a standalone weight of any type is rejected --- edge_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/edge_test.go b/edge_test.go index a3191a4..80e0f7d 100644 --- a/edge_test.go +++ b/edge_test.go @@ -81,6 +81,14 @@ func TestNewErrors(t *testing.T) { map[string]string{"a": `{"format":"x","weight":5}`}, "weight only skews a choice's items", }, + "non-numeric weight outside a choice": { + map[string]string{"a": `{"format":"x","weight":"bad"}`}, + "weight only skews a choice's items", + }, + "weight used as a field": { + map[string]string{"a": `{"format":"{name} {weight}kg","name":["Anvil"],"weight":["7"]}`}, + "can never be a field", + }, "an option name used as a token": { map[string]string{"a": `{"format":"{weight}"}`}, `"weight" is an option, never a field`,