github.com/gopherjs/gopherjs@v1.19.0-beta1.0.20240506212314-27071a8796e4/compiler/natives/src/internal/reflectlite/all_test.go (about) 1 //go:build js 2 // +build js 3 4 package reflectlite_test 5 6 import ( 7 "testing" 8 9 . "internal/reflectlite" 10 ) 11 12 func TestTypes(t *testing.T) { 13 for i, tt := range typeTests { 14 if i == 30 { 15 continue 16 } 17 testReflectType(t, i, Field(ValueOf(tt.i), 0).Type(), tt.s) 18 } 19 } 20 21 func TestNameBytesAreAligned(t *testing.T) { 22 t.Skip("TestNameBytesAreAligned") 23 } 24 25 // `A` is used with `B[T any]` and is otherwise not needed. 26 // 27 //gopherjs:purge for go1.19 without generics 28 type ( 29 A struct{} 30 B[T any] struct{} 31 ) 32 33 // removing the name tests using `B[T any]` for go1.19 without generics 34 var nameTests = []nameTest{ 35 {(*int32)(nil), "int32"}, 36 {(*D1)(nil), "D1"}, 37 {(*[]D1)(nil), ""}, 38 {(*chan D1)(nil), ""}, 39 {(*func() D1)(nil), ""}, 40 {(*<-chan D1)(nil), ""}, 41 {(*chan<- D1)(nil), ""}, 42 {(*any)(nil), ""}, 43 {(*interface { 44 F() 45 })(nil), ""}, 46 {(*TheNameOfThisTypeIsExactly255BytesLongSoWhenTheCompilerPrependsTheReflectTestPackageNameAndExtraStarTheLinkerRuntimeAndReflectPackagesWillHaveToCorrectlyDecodeTheSecondLengthByte0123456789_0123456789_0123456789_0123456789_0123456789_012345678)(nil), "TheNameOfThisTypeIsExactly255BytesLongSoWhenTheCompilerPrependsTheReflectTestPackageNameAndExtraStarTheLinkerRuntimeAndReflectPackagesWillHaveToCorrectlyDecodeTheSecondLengthByte0123456789_0123456789_0123456789_0123456789_0123456789_012345678"}, 47 }