summaryrefslogtreecommitdiff
path: root/src/pkg/path/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/path/path_test.go')
-rw-r--r--src/pkg/path/path_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pkg/path/path_test.go b/src/pkg/path/path_test.go
index 77f080433..220ec1a0b 100644
--- a/src/pkg/path/path_test.go
+++ b/src/pkg/path/path_test.go
@@ -67,6 +67,16 @@ func TestClean(t *testing.T) {
if s := Clean(test.path); s != test.result {
t.Errorf("Clean(%q) = %q, want %q", test.path, s, test.result)
}
+ if s := Clean(test.result); s != test.result {
+ t.Errorf("Clean(%q) = %q, want %q", test.result, s, test.result)
+ }
+ }
+
+ for _, test := range cleantests {
+ allocs := testing.AllocsPerRun(100, func() { Clean(test.result) })
+ if allocs > 0 {
+ t.Errorf("Clean(%q): %v allocs, want zero", test.result, allocs)
+ }
}
}
@@ -181,6 +191,7 @@ var dirtests = []PathTest{
{"x/", "x"},
{"abc", "."},
{"abc/def", "abc"},
+ {"abc////def", "abc"},
{"a/b/.x", "a/b"},
{"a/b/c.", "a/b"},
{"a/b/c.x", "a/b"},