mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Fix lang/check tests
This commit is contained in:
1 parent
d92e90d4f0
commit
7fb19d7669
2 files changed
+4
-2
No files matched your search
@@ -58,6 +58,8 @@ func compareToWuffsfmt(tm *token.Map, tokens []token.Token, comments []string, s
|
|||||||
func TestCheck(t *testing.T) {
|
func TestCheck(t *testing.T) {
|
||||||
const filename = "test.wuffs"
|
const filename = "test.wuffs"
|
||||||
src := strings.TrimSpace(`
|
src := strings.TrimSpace(`
|
||||||
|
packageid "test"
|
||||||
|
|
||||||
pri struct foo(
|
pri struct foo(
|
||||||
i i32,
|
i i32,
|
||||||
)
|
)
|
||||||
@@ -192,7 +194,7 @@ func TestConstValues(t *testing.T) {
|
|||||||
|
|
||||||
tm := &token.Map{}
|
tm := &token.Map{}
|
||||||
for s, wantInt64 := range testCases {
|
for s, wantInt64 := range testCases {
|
||||||
src := "pri func foo()() {\n\t" + s + "\n}\n"
|
src := "packageid \"test\"\npri func foo()() {\n\t" + s + "\n}\n"
|
||||||
|
|
||||||
tokens, _, err := token.Tokenize(tm, filename, []byte(src))
|
tokens, _, err := token.Tokenize(tm, filename, []byte(src))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ func parseBuiltInFuncs(tm *t.Map, ss []string, generic bool) (map[t.QID]*a.Func,
|
|||||||
|
|
||||||
tlds := file.TopLevelDecls()
|
tlds := file.TopLevelDecls()
|
||||||
if len(tlds) != 1 || tlds[0].Kind() != a.KFunc {
|
if len(tlds) != 1 || tlds[0].Kind() != a.KFunc {
|
||||||
return nil, fmt.Errorf("parsing %c: got %d top level decls, want %d", s, len(tlds), 1)
|
return nil, fmt.Errorf("check: parsing %q: got %d top level decls, want %d", s, len(tlds), 1)
|
||||||
}
|
}
|
||||||
f := tlds[0].Func()
|
f := tlds[0].Func()
|
||||||
m[f.QID()] = f
|
m[f.QID()] = f
|
||||||
|
|||||||
Reference in new issue
Block a user