Refuse a calc over digits(0) or a repeat of 0, name an option's wrong kind as JSON does, type the name scope kinds, and compile only from a jsonvalue.Value

This commit is contained in:
2026-10-08 00:02:07 +02:00
committed by Lillem4n
parent ba2ae41ffe
commit 97e72988b1
13 changed files with 106 additions and 55 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ import (
"testing"
"testing/fstest"
"github.com/larvit/fejkdata/internal/datafiles"
"github.com/larvit/fejkdata/internal/drawstate"
"github.com/larvit/fejkdata/internal/jsonvalue"
)
// newGenerator creates a generator over a single data directory, failing on
@@ -102,9 +102,9 @@ func engine(seed uint64) *Generator {
}
// parse unmarshals a JSON template fragment into its dynamic form.
func parse(t *testing.T, s string) any {
func parse(t *testing.T, s string) jsonvalue.Value {
t.Helper()
v, err := datafiles.DecodeJSON([]byte(s))
v, err := jsonvalue.Decode([]byte(s))
if err != nil {
t.Fatalf("parse %q: %v", s, err)
}