mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
reflect; uncomment SetZero (but comment out the parts that fail)
This commit is contained in:
@@ -1450,8 +1450,6 @@ func TestIsNil(t *testing.T) {
|
||||
NotNil(fi, t)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
func TestIsZero(t *testing.T) {
|
||||
for i, tt := range []struct {
|
||||
x any
|
||||
@@ -1561,14 +1559,20 @@ func TestIsZero(t *testing.T) {
|
||||
t.Errorf("%d: IsZero(Zero(TypeOf((%s)(%+v)))) is false", i, x.Kind(), tt.x)
|
||||
}
|
||||
|
||||
/* // TODO(tinygo): missing SetZero support
|
||||
|
||||
p := New(x.Type()).Elem()
|
||||
p.Set(x)
|
||||
p.SetZero()
|
||||
if !p.IsZero() {
|
||||
t.Errorf("%d: IsZero((%s)(%+v)) is true after SetZero", i, p.Kind(), tt.x)
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
/* // TODO(tinygo): panic/recover support
|
||||
func() {
|
||||
defer func() {
|
||||
if r := recover(); r == nil {
|
||||
@@ -1577,8 +1581,10 @@ func TestIsZero(t *testing.T) {
|
||||
}()
|
||||
(Value{}).IsZero()
|
||||
}()
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
func TestInterfaceExtraction(t *testing.T) {
|
||||
var s struct {
|
||||
W io.Writer
|
||||
|
||||
Reference in New Issue
Block a user