summaryrefslogtreecommitdiff
path: root/src/pkg/path/filepath/match_test.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-06-03 11:31:24 +0200
committerOndřej Surý <ondrej@sury.org>2011-06-03 11:31:24 +0200
commit56135c623a865c501ab31cc940c0e22ece2673f4 (patch)
treef69e04e82bbf75bdab0f624430ef265425e62b35 /src/pkg/path/filepath/match_test.go
parent63d29fefab5290dc96e0a03ff70603aefa995887 (diff)
downloadgolang-56135c623a865c501ab31cc940c0e22ece2673f4.tar.gz
Imported Upstream version 2011.06.02upstream-weekly/2011.06.02
Diffstat (limited to 'src/pkg/path/filepath/match_test.go')
-rw-r--r--src/pkg/path/filepath/match_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pkg/path/filepath/match_test.go b/src/pkg/path/filepath/match_test.go
index 43e1c1cc2..a1c8333f3 100644
--- a/src/pkg/path/filepath/match_test.go
+++ b/src/pkg/path/filepath/match_test.go
@@ -69,6 +69,13 @@ var matchTests = []MatchTest{
{"*x", "xxx", true, nil},
}
+func errp(e os.Error) string {
+ if e == nil {
+ return "<nil>"
+ }
+ return e.String()
+}
+
func TestMatch(t *testing.T) {
if runtime.GOOS == "windows" {
// XXX: Don't pass for windows.
@@ -77,7 +84,7 @@ func TestMatch(t *testing.T) {
for _, tt := range matchTests {
ok, err := Match(tt.pattern, tt.s)
if ok != tt.match || err != tt.err {
- t.Errorf("Match(%#q, %#q) = %v, %v want %v, nil", tt.pattern, tt.s, ok, err, tt.match)
+ t.Errorf("Match(%#q, %#q) = %v, %q want %v, %q", tt.pattern, tt.s, ok, errp(err), tt.match, errp(tt.err))
}
}
}