mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 11:33:59 +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)
|
NotNil(fi, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
func TestIsZero(t *testing.T) {
|
func TestIsZero(t *testing.T) {
|
||||||
for i, tt := range []struct {
|
for i, tt := range []struct {
|
||||||
x any
|
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)
|
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 := New(x.Type()).Elem()
|
||||||
p.Set(x)
|
p.Set(x)
|
||||||
p.SetZero()
|
p.SetZero()
|
||||||
if !p.IsZero() {
|
if !p.IsZero() {
|
||||||
t.Errorf("%d: IsZero((%s)(%+v)) is true after SetZero", i, p.Kind(), tt.x)
|
t.Errorf("%d: IsZero((%s)(%+v)) is true after SetZero", i, p.Kind(), tt.x)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* // TODO(tinygo): panic/recover support
|
||||||
func() {
|
func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r == nil {
|
if r := recover(); r == nil {
|
||||||
@@ -1577,8 +1581,10 @@ func TestIsZero(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
(Value{}).IsZero()
|
(Value{}).IsZero()
|
||||||
}()
|
}()
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func TestInterfaceExtraction(t *testing.T) {
|
func TestInterfaceExtraction(t *testing.T) {
|
||||||
var s struct {
|
var s struct {
|
||||||
W io.Writer
|
W io.Writer
|
||||||
|
|||||||
Reference in New Issue
Block a user