moved a subset of source file to the kern package

This commit is contained in:
2026-04-27 19:43:37 +02:00
parent f100adead3
commit 4d910dd069
107 changed files with 2080 additions and 1380 deletions
+9 -7
View File
@@ -9,6 +9,8 @@ import (
"strings"
"testing"
"git.portale-stac.it/go-pkg/expr/kern"
)
func TestDictParser(t *testing.T) {
@@ -37,7 +39,7 @@ func TestDictParser(t *testing.T) {
//"b":2,
"c":3
}`, map[any]any{"a": 1, "c": 3}, nil},
}
}
succeeded := 0
failed := 0
@@ -51,7 +53,7 @@ func TestDictParser(t *testing.T) {
var gotResult any
var gotErr error
ctx := NewSimpleStore()
ctx := NewSimpleStoreWithoutGlobalContext()
ctx.SetVar("var1", int64(123))
ctx.SetVar("var2", "abc")
ImportMathFuncs(ctx)
@@ -118,11 +120,11 @@ func TestDictToStringMultiLine(t *testing.T) {
want := `{
"first": 1
}`
args := map[any]*term{
args := map[any]any{
"first": newLiteralTerm(NewValueToken(0, 0, SymInteger, "1", 1)),
}
dict := newDict(args)
got := dict.ToString(MultiLine)
dict := kern.NewDict(args)
got := dict.ToString(kern.MultiLine)
// fmt.Printf("got=%q\n", got)
if good = got == want; !good {
@@ -140,10 +142,10 @@ func TestDictToString(t *testing.T) {
var good bool
section := "dict-ToString-SL"
want := `{"first": 1}`
args := map[any]*term{
args := map[any]any{
"first": newLiteralTerm(NewValueToken(0, 0, SymInteger, "1", 1)),
}
dict := newDict(args)
dict := kern.NewDict(args)
got := dict.ToString(0)
// fmt.Printf("got=%q\n", got)