reflect: uncomment Type.String() tests that pass

Этот коммит содержится в:
Damian Gryski 2023-03-24 10:42:34 -07:00 коммит произвёл Ron Evans
родитель e7bd22edf2
коммит 53b95cad08

Просмотреть файл

@ -129,6 +129,7 @@ var typeTests = []pair{
}{}, }{},
"struct { c chan *int32; d float32 }", "struct { c chan *int32; d float32 }",
}, },
/* // TODO(tinygo): No function support
{struct{ x (func(a int8, b int32)) }{}, "func(int8, int32)"}, {struct{ x (func(a int8, b int32)) }{}, "func(int8, int32)"},
{struct { {struct {
x struct { x struct {
@ -136,7 +137,7 @@ var typeTests = []pair{
} }
}{}, }{},
"struct { c func(chan *reflect_test.integer, *int8) }", "struct { c func(chan *reflect_test.integer, *int8) }",
}, }, */
{struct { {struct {
x struct { x struct {
a int8 a int8
@ -187,6 +188,7 @@ var typeTests = []pair{
}{}, }{},
"struct { a int8; b int8; c int8; d int8; e int8; f int32 }", "struct { a int8; b int8; c int8; d int8; e int8; f int32 }",
}, },
/* // TODO(tinygo): Reflects tags aren't properly quoted
{struct { {struct {
x struct { x struct {
a int8 `reflect:"hi there"` a int8 `reflect:"hi there"`
@ -224,6 +226,7 @@ var typeTests = []pair{
}{}, }{},
"struct { int32; int64 }", "struct { int32; int64 }",
}, },
*/
} }
var valueTests = []pair{ var valueTests = []pair{
@ -249,16 +252,18 @@ var valueTests = []pair{
{new(**integer), "**reflect_test.integer(0)"}, {new(**integer), "**reflect_test.integer(0)"},
{new(map[string]int32), "map[string]int32{<can't iterate on maps>}"}, {new(map[string]int32), "map[string]int32{<can't iterate on maps>}"},
{new(chan<- string), "chan<- string"}, {new(chan<- string), "chan<- string"},
{new(func(a int8, b int32)), "func(int8, int32)(0)"}, //{new(func(a int8, b int32)), "func(int8, int32)(0)"}, // TODO(tinygo): No function support
{new(struct { {new(struct {
c chan *int32 c chan *int32
d float32 d float32
}), }),
"struct { c chan *int32; d float32 }{chan *int32, 0}", "struct { c chan *int32; d float32 }{chan *int32, 0}",
}, },
/* // TODO(tinygo): No function support
{new(struct{ c func(chan *integer, *int8) }), {new(struct{ c func(chan *integer, *int8) }),
"struct { c func(chan *reflect_test.integer, *int8) }{func(chan *reflect_test.integer, *int8)(0)}", "struct { c func(chan *reflect_test.integer, *int8) }{func(chan *reflect_test.integer, *int8)(0)}",
}, },
*/
{new(struct { {new(struct {
a int8 a int8
b int32 b int32
@ -281,8 +286,6 @@ func testType(t *testing.T, i int, typ Type, want string) {
} }
} }
/*
func TestTypes(t *testing.T) { func TestTypes(t *testing.T) {
for i, tt := range typeTests { for i, tt := range typeTests {
testType(t, i, ValueOf(tt.i).Field(0).Type(), tt.s) testType(t, i, ValueOf(tt.i).Field(0).Type(), tt.s)
@ -378,6 +381,8 @@ func TestSetValue(t *testing.T) {
} }
} }
/*
func TestMapIterSet(t *testing.T) { func TestMapIterSet(t *testing.T) {
m := make(map[string]any, len(valueTests)) m := make(map[string]any, len(valueTests))
for _, tt := range valueTests { for _, tt := range valueTests {