aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-04 19:52:49 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-04 20:25:22 +0200
commitb06c1bd324d3aff0f132381727c85940bcf93b2f (patch)
treeb4dce609e6711e2a7f8fbebe36ca2fcd05321ae7 /pkg/compiler/compiler_test.go
parent8094a4202f10d59457a2a33d4e276b32c0ca16bf (diff)
pkg/compiler: verify validity of len targets
Update #217
Diffstat (limited to 'pkg/compiler/compiler_test.go')
-rw-r--r--pkg/compiler/compiler_test.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go
index 261cffe9c..40450f6a4 100644
--- a/pkg/compiler/compiler_test.go
+++ b/pkg/compiler/compiler_test.go
@@ -37,16 +37,20 @@ func TestErrors(t *testing.T) {
"C1": 1,
"C2": 2,
}
- name := "errors.txt"
- em := ast.NewErrorMatcher(t, filepath.Join("testdata", name))
- desc := ast.Parse(em.Data, name, em.ErrorHandler)
- if desc == nil {
- em.DumpErrors(t)
- t.Fatalf("parsing failed")
+ for _, name := range []string{"errors.txt", "recursion.txt", "len.txt"} {
+ name := name
+ t.Run(name, func(t *testing.T) {
+ em := ast.NewErrorMatcher(t, filepath.Join("testdata", name))
+ desc := ast.Parse(em.Data, name, em.ErrorHandler)
+ if desc == nil {
+ em.DumpErrors(t)
+ t.Fatalf("parsing failed")
+ }
+ ExtractConsts(desc, em.ErrorHandler)
+ Compile(desc, consts, em.ErrorHandler)
+ em.Check(t)
+ })
}
- ExtractConsts(desc, em.ErrorHandler)
- Compile(desc, consts, em.ErrorHandler)
- em.Check(t)
}
func TestFuzz(t *testing.T) {