aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ast/test_util.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/ast/test_util.go')
-rw-r--r--pkg/ast/test_util.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/ast/test_util.go b/pkg/ast/test_util.go
index 0aed0a2dc..b9fe12152 100644
--- a/pkg/ast/test_util.go
+++ b/pkg/ast/test_util.go
@@ -7,6 +7,7 @@ import (
"bufio"
"bytes"
"io/ioutil"
+ "path/filepath"
"strings"
"testing"
)
@@ -41,7 +42,7 @@ func NewErrorMatcher(t *testing.T, file string) *ErrorMatcher {
break
}
errors = append(errors, &errorDesc{
- file: file,
+ file: filepath.Base(file),
line: i,
text: strings.TrimSpace(string(ln[pos+3:])),
})
@@ -82,13 +83,13 @@ nextErr:
want.matched = true
continue nextErr
}
- t.Errorf("unexpected error: %v:%v:%v: %v", e.file, e.line, e.col, e.text)
+ t.Errorf("unexpected error:\n%v:%v:%v: %v", e.file, e.line, e.col, e.text)
}
for _, want := range em.expect {
if want.matched {
continue
}
- t.Errorf("unmatched error: %v:%v: %v", want.file, want.line, want.text)
+ t.Errorf("unmatched error:\n%v:%v: %v", want.file, want.line, want.text)
}
}