aboutsummaryrefslogtreecommitdiff
path: root/src/path/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/path/path_test.go')
-rw-r--r--src/path/path_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/path/path_test.go b/src/path/path_test.go
index a57286f6b8..6bd7a2cdad 100644
--- a/src/path/path_test.go
+++ b/src/path/path_test.go
@@ -5,6 +5,7 @@
package path_test
import (
+ "path"
. "path"
"runtime"
"testing"
@@ -234,3 +235,14 @@ func TestIsAbs(t *testing.T) {
}
}
}
+
+func BenchmarkJoin(b *testing.B) {
+ b.ReportAllocs()
+ parts := []string{"one", "two", "three", "four"}
+ s := parts[0]
+ for b.Loop() {
+ parts[0] = s
+ s = path.Join(parts...)
+ s = s[:3]
+ }
+}