mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
Fix check_test.go for recent changes
This commit is contained in:
1 parent
40c5328d94
commit
ba05d5beed
1 file changed
+23
-8
@@ -117,11 +117,18 @@ func TestCheck(tt *testing.T) {
|
|||||||
tt.Fatalf("Check: %v", err)
|
tt.Fatalf("Check: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// There are 2 funcs: the implicit foo.reset method, and the explicit
|
// There are 2 funcs in this package: the implicit foo.reset method, and
|
||||||
// foo.bar method.
|
// the explicit foo.bar method.
|
||||||
if len(c.funcs) != 2 {
|
nFuncs := 0
|
||||||
|
for qqid := range c.funcs {
|
||||||
|
if qqid[0] == 0 {
|
||||||
|
nFuncs++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if nFuncs != 2 {
|
||||||
tt.Fatalf("c.funcs: got %d elements, want 2", len(c.funcs))
|
tt.Fatalf("c.funcs: got %d elements, want 2", len(c.funcs))
|
||||||
}
|
}
|
||||||
|
|
||||||
qqid := t.QQID{0, tm.ByName("foo"), tm.ByName("bar")}
|
qqid := t.QQID{0, tm.ByName("foo"), tm.ByName("bar")}
|
||||||
fooBar := c.funcs[qqid]
|
fooBar := c.funcs[qqid]
|
||||||
if fooBar == nil {
|
if fooBar == nil {
|
||||||
@@ -219,14 +226,22 @@ func TestConstValues(tt *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.funcs) != 1 {
|
// There is 1 func in this package: foo.
|
||||||
|
nFuncs := 0
|
||||||
|
for qqid := range c.funcs {
|
||||||
|
if qqid[0] == 0 {
|
||||||
|
nFuncs++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if nFuncs != 1 {
|
||||||
tt.Errorf("%q: Funcs: got %d elements, want 1", s, len(c.funcs))
|
tt.Errorf("%q: Funcs: got %d elements, want 1", s, len(c.funcs))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
foo := (*a.Func)(nil)
|
|
||||||
for _, f := range c.funcs {
|
foo := c.funcs[t.QQID{0, 0, tm.ByName("foo")}]
|
||||||
foo = f
|
if foo == nil {
|
||||||
break
|
tt.Errorf("%q: cannot look up func foo", s)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
body := foo.Body()
|
body := foo.Body()
|
||||||
if len(body) != 1 {
|
if len(body) != 1 {
|
||||||
|
|||||||
Reference in new issue
Block a user