t_parser_test.go: Expr's type names
This commit is contained in:
parent
e4ded4f746
commit
9e63e1402e
@ -201,7 +201,7 @@ func doTest(t *testing.T, section string, input *inputType, count int) (good boo
|
|||||||
eq := reflect.DeepEqual(gotResult, input.wantResult)
|
eq := reflect.DeepEqual(gotResult, input.wantResult)
|
||||||
|
|
||||||
if !eq /*gotResult != input.wantResult*/ {
|
if !eq /*gotResult != input.wantResult*/ {
|
||||||
t.Errorf("%d: %q -> result = %v [%T], want = %v [%T]", count, input.source, gotResult, gotResult, input.wantResult, input.wantResult)
|
t.Errorf("%d: %q -> result = %v [%s], want = %v [%s]", count, input.source, gotResult, typeName(gotResult), input.wantResult, typeName(input.wantResult))
|
||||||
good = false
|
good = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,6 +214,21 @@ func doTest(t *testing.T, section string, input *inputType, count int) (good boo
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
func typeName(v any) (s string) {
|
||||||
|
if v != nil {
|
||||||
|
if typer,ok:=v.(Typer);ok {
|
||||||
|
s = typer.TypeName()
|
||||||
|
}else{
|
||||||
|
s=fmt.Sprintf("%T", v)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
s = "nil"
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func logTest(t *testing.T, n int, section, source string, wantResult any, wantErr error) {
|
func logTest(t *testing.T, n int, section, source string, wantResult any, wantErr error) {
|
||||||
if wantErr == nil {
|
if wantErr == nil {
|
||||||
t.Logf("[+]%s nr %3d -- %q --> %v", section, n, source, wantResult)
|
t.Logf("[+]%s nr %3d -- %q --> %v", section, n, source, wantResult)
|
||||||
|
Loading…
Reference in New Issue
Block a user