From 7fb19d7669aba629c28d29a14e5c66e508c59fd2 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 28 Dec 2017 11:04:31 +1100 Subject: [PATCH] Fix lang/check tests --- lang/check/check_test.go | 4 +++- lang/check/resolve.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lang/check/check_test.go b/lang/check/check_test.go index 08cc2f62..78b7c637 100644 --- a/lang/check/check_test.go +++ b/lang/check/check_test.go @@ -58,6 +58,8 @@ func compareToWuffsfmt(tm *token.Map, tokens []token.Token, comments []string, s func TestCheck(t *testing.T) { const filename = "test.wuffs" src := strings.TrimSpace(` + packageid "test" + pri struct foo( i i32, ) @@ -192,7 +194,7 @@ func TestConstValues(t *testing.T) { tm := &token.Map{} 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)) if err != nil { diff --git a/lang/check/resolve.go b/lang/check/resolve.go index 5284e98a..b28cd809 100644 --- a/lang/check/resolve.go +++ b/lang/check/resolve.go @@ -122,7 +122,7 @@ func parseBuiltInFuncs(tm *t.Map, ss []string, generic bool) (map[t.QID]*a.Func, tlds := file.TopLevelDecls() 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() m[f.QID()] = f