A few test failures seen while packaging for GNU Guix
Hi!
While packaging this package, I noted the following test failures:
=== CONT TestBaseIndent/1
=== NAME TestFiles/slow.input
printer_test.go:147:
length changed: len(testdata/slow.input) = 2070, len(testdata/slow.golden) = 2071
testdata/slow.input:12:16: func TestTwoNilValues(t *testing.T) {
testdata/slow.golden:12:16: func TestTwoNilRValues(t *testing.T) {
--- PASS: TestBaseIndent (0.00s)
--- PASS: TestBaseIndent/2 (0.01s)
--- PASS: TestBaseIndent/1 (0.02s)
--- PASS: TestBaseIndent/0 (0.02s)
--- PASS: TestBaseIndent/3 (0.02s)
--- FAIL: TestFiles (0.00s)
--- PASS: TestFiles/empty.input (0.00s)
--- PASS: TestFiles/comments2.input (0.00s)
--- PASS: TestFiles/statements.input (0.01s)
--- FAIL: TestFiles/slow.input (0.01s)
--- PASS: TestFiles/linebreaks.input (0.02s)
--- PASS: TestFiles/declarations.input (0.02s)
--- PASS: TestFiles/expressions.input (0.02s)
--- PASS: TestFiles/expressions.input#01 (0.02s)
--- PASS: TestWriteErrors (0.04s)
--- PASS: TestBadComments (0.04s)
=== RUN ExampleFprint
--- PASS: ExampleFprint (0.00s)
FAIL
FAIL github.com/cosmos72/gomacro/go/printer 0.050s
[...]
--- PASS: TestNumbers (0.00s)
PASS
ok github.com/cosmos72/gomacro/go/scanner 0.004s
FAIL github.com/cosmos72/gomacro/go/types [build failed]
[...]
=== RUN TestFromReflect5
// debug: FromReflectType: xreflect.myType
// debug: importer: cannot find package "github.com/cosmos72/gomacro/xreflect" metadata, approximating it with reflection
// debug: . interface xreflect.myType
// debug: . . fromReflectInterface: add interface method rtype: func() xreflect.myType, gotype: func() github.com/cosmos72/gomacro/xreflect.myType (receiver: <nil>)
// debug: . . struct xreflect.myStructField
// debug: . . . slice []int
// debug: . . . . no methods to scan for: []int
// debug: . . . no methods to scan for: xreflect.myStructField
// debug: . . fromReflectInterface: add interface method rtype: func(int) xreflect.myStructField, gotype: func(int) github.com/cosmos72/gomacro/xreflect.myStructField (receiver: <nil>)
// debug: . . will scan methods of: github.com/cosmos72/gomacro/xreflect.myType
--- PASS: TestFromReflect5 (0.00s)
=== RUN TestFromReflect6
// debug: FromReflectType: reflect.Type
// debug: . will scan methods of: reflect.Type
z_test.go:36: expecting interface{Align() int; AssignableTo(reflect.Type) bool; Bits() int; ChanDir() reflect.ChanDir; Comparable() bool; ConvertibleTo(reflect.Type) bool; Elem() reflect.Type; Field(int) reflect.StructField; FieldAlign() int; FieldByIndex([]int) reflect.StructField; FieldByName(string) (reflect.StructField, bool); FieldByNameFunc(func(string) bool) (reflect.StructField, bool); Implements(reflect.Type) bool; In(int) reflect.Type; IsVariadic() bool; Key() reflect.Type; Kind() reflect.Kind; Len() int; Method(int) reflect.Method; MethodByName(string) (reflect.Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(int) reflect.Type; PkgPath() string; Size() uintptr; String() string; common() *reflect.rtype; uncommon() *reflect.uncommonType} <string>, found interface{Align() int; AssignableTo(u reflect.Type) bool; Bits() int; ChanDir() reflect.ChanDir; Comparable() bool; ConvertibleTo(u reflect.Type) bool; Elem() reflect.Type; Field(i int) reflect.StructField; FieldAlign() int; FieldByIndex(index []int) reflect.StructField; FieldByName(name string) (reflect.StructField, bool); FieldByNameFunc(match func(string) bool) (reflect.StructField, bool); Implements(u reflect.Type) bool; In(i int) reflect.Type; IsVariadic() bool; Key() reflect.Type; Kind() reflect.Kind; Len() int; Method(int) reflect.Method; MethodByName(string) (reflect.Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(i int) reflect.Type; PkgPath() string; Size() uintptr; String() string; common() *internal/abi.Type; uncommon() *internal/abi.UncommonType} <string>
--- FAIL: TestFromReflect6 (0.05s)
=== RUN TestFromReflect7
--- PASS: TestFromReflect7 (0.00s)
=== RUN TestFromReflectMutualRecursion
// debug: FromReflectType: xreflect.Request4Test
// debug: . struct xreflect.Request4Test
// debug: . . map map[string]string
// debug: . . . no methods to scan for: map[string]string
// debug: . . ptr *xreflect.Response4Test
// debug: . . . struct xreflect.Response4Test
// debug: . . . . ptr *xreflect.Request4Test
// debug: . . . . . no methods to scan for: *xreflect.Request4Test
// debug: . . . . no methods to scan for: xreflect.Response4Test
// debug: . . . no methods to scan for: *xreflect.Response4Test
// debug: . . no methods to scan for: xreflect.Request4Test
--- PASS: TestFromReflectMutualRecursion (0.00s)
=== RUN TestInterfaceIoReader
// debug: FromReflectType: *io.Reader
// debug: . ptr *io.Reader
// debug: . . will scan methods of: io.Reader
// debug: . . no methods to scan for: *io.Reader
--- PASS: TestInterfaceIoReader (0.00s)
=== RUN TestImporter
--- PASS: TestImporter (0.07s)
=== RUN TestInterfaceIoReadWriter
--- PASS: TestInterfaceIoReadWriter (0.00s)
FAIL
FAIL github.com/cosmos72/gomacro/xreflect 0.206s
FAIL
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "go" arguments: ("test" "github.com/cosmos72/gomacro/...") exit-status: 1 term-signal: #f stop-signal: #f>
phase `check' failed after 8.9 seconds
command "go" "test" "github.com/cosmos72/gomacro/..."
That's when building with the following inputs: [email protected] [email protected] [email protected].
The Go version used to build is at version 1.21.
The go doesn't seem to matter, as long as Go 1.20 is available. The test failures are the same from Go 1.20 through Go 1.24.
The tests under github.com/cosmos72/gomacro/go/ are inherited from Go toolchain, and are known to fail - just ignore or disable them.
Perhaps they can be marked as expected failures in the test suite, to avoid such report in the future? Thanks for the reply/info!