moved a subset of source file to the kern package
This commit is contained in:
+9
-7
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user