Test internal/grammar, and allow the root to import it

This commit is contained in:
2026-10-05 12:06:43 +02:00
committed by Lillem4n
parent 46895151c8
commit 41292f9d89
9 changed files with 170 additions and 33 deletions
+3 -1
View File
@@ -9,6 +9,8 @@ import (
"strings"
"testing"
"time"
"github.com/larvit/fejkdata/internal/grammar"
)
func TestBuiltinIDGenerators(t *testing.T) {
@@ -454,7 +456,7 @@ func TestNoRefOperandsMatchesTheOperandGrammar(t *testing.T) {
if b.operands == nil {
continue
}
if takesRef := slices.ContainsFunc(b.operands([]string{"/x"}), isRef); b.noRefOperands == takesRef {
if takesRef := slices.ContainsFunc(b.operands([]string{"/x"}), grammar.IsRef); b.noRefOperands == takesRef {
t.Errorf("%s: noRefOperands = %v, but its operands func reads a reference: %v", name, b.noRefOperands, takesRef)
}
}