From 53b95cad083cb0ca30f94f94f1ee00f69aa78f6a Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Fri, 24 Mar 2023 10:42:34 -0700 Subject: [PATCH] reflect: uncomment Type.String() tests that pass --- src/reflect/all_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index 18712a11..b21abfef 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -129,6 +129,7 @@ var typeTests = []pair{ }{}, "struct { c chan *int32; d float32 }", }, + /* // TODO(tinygo): No function support {struct{ x (func(a int8, b int32)) }{}, "func(int8, int32)"}, {struct { x struct { @@ -136,7 +137,7 @@ var typeTests = []pair{ } }{}, "struct { c func(chan *reflect_test.integer, *int8) }", - }, + }, */ {struct { x struct { a int8 @@ -187,6 +188,7 @@ var typeTests = []pair{ }{}, "struct { a int8; b int8; c int8; d int8; e int8; f int32 }", }, + /* // TODO(tinygo): Reflects tags aren't properly quoted {struct { x struct { a int8 `reflect:"hi there"` @@ -224,6 +226,7 @@ var typeTests = []pair{ }{}, "struct { int32; int64 }", }, + */ } var valueTests = []pair{ @@ -249,16 +252,18 @@ var valueTests = []pair{ {new(**integer), "**reflect_test.integer(0)"}, {new(map[string]int32), "map[string]int32{}"}, {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 { c chan *int32 d float32 }), "struct { c chan *int32; d float32 }{chan *int32, 0}", }, + /* // TODO(tinygo): No function support {new(struct{ c func(chan *integer, *int8) }), "struct { c func(chan *reflect_test.integer, *int8) }{func(chan *reflect_test.integer, *int8)(0)}", }, + */ {new(struct { a int8 b int32 @@ -281,8 +286,6 @@ func testType(t *testing.T, i int, typ Type, want string) { } } -/* - func TestTypes(t *testing.T) { for i, tt := range typeTests { 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) { m := make(map[string]any, len(valueTests)) for _, tt := range valueTests {