The function parameter model has been modified to support the passing of named parameters
This commit is contained in:
+5
-3
@@ -42,6 +42,8 @@ func runCtxTestSuite(t *testing.T, ctx ExprContext, section string, inputs []inp
|
||||
failed := 0
|
||||
|
||||
for i, input := range inputs {
|
||||
// fmt.Printf("%3d: %s\n", i+1, input.source)
|
||||
|
||||
good := doTest(t, ctx, section, &input, i+1)
|
||||
if good {
|
||||
succeeded++
|
||||
@@ -91,7 +93,7 @@ func doTest(t *testing.T, ctx ExprContext, section string, input *inputType, cou
|
||||
eq := reflect.DeepEqual(gotResult, input.wantResult)
|
||||
|
||||
if !eq /*gotResult != input.wantResult*/ {
|
||||
t.Errorf("%d: %q -> result = %v [%s], want = %v [%s]", count, input.source, gotResult, TypeName(gotResult), input.wantResult, TypeName(input.wantResult))
|
||||
t.Errorf("%d: `%s` -> result = %v [%s], want = %v [%s]", count, input.source, gotResult, TypeName(gotResult), input.wantResult, TypeName(input.wantResult))
|
||||
good = false
|
||||
}
|
||||
|
||||
@@ -106,8 +108,8 @@ func doTest(t *testing.T, ctx ExprContext, section string, input *inputType, cou
|
||||
|
||||
func logTest(t *testing.T, n int, section, source string, wantResult any, wantErr error) {
|
||||
if wantErr == nil {
|
||||
t.Logf("[+]%s nr %3d -- %q --> %v", section, n, source, wantResult)
|
||||
t.Logf("[+]%s nr %3d -- `%s` --> %v", section, n, source, wantResult)
|
||||
} else {
|
||||
t.Logf("[-]%s nr %3d -- %q --> %v", section, n, source, wantErr)
|
||||
t.Logf("[-]%s nr %3d -- `%s` --> %v", section, n, source, wantErr)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user