summaryrefslogtreecommitdiffstats
path: root/src/util/util_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-08-14 01:53:06 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-08-14 02:19:29 +0900
commitddc7bb9064042a0d5da9546eaf6ff888dca63f0c (patch)
tree0eb63cd7c0cdc221332496ca2ddf3dcfe3cbb876 /src/util/util_test.go
parent1d4057c20907b7d263d6f2b8cb4350a024859dfe (diff)
[perf] Optimize AWK-style tokenizer for --nth
Approx. 50% less memory footprint and 40% improvement in query time
Diffstat (limited to 'src/util/util_test.go')
-rw-r--r--src/util/util_test.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/util/util_test.go b/src/util/util_test.go
index 8aeaeac5..06cfd4f2 100644
--- a/src/util/util_test.go
+++ b/src/util/util_test.go
@@ -20,23 +20,3 @@ func TestContrain(t *testing.T) {
t.Error("Expected", 3)
}
}
-
-func TestTrimLen(t *testing.T) {
- check := func(str string, exp int) {
- trimmed := TrimLen([]rune(str))
- if trimmed != exp {
- t.Errorf("Invalid TrimLen result for '%s': %d (expected %d)",
- str, trimmed, exp)
- }
- }
- check("hello", 5)
- check("hello ", 5)
- check("hello ", 5)
- check(" hello", 5)
- check(" hello", 5)
- check(" hello ", 5)
- check(" hello ", 5)
- check("h o", 5)
- check(" h o ", 5)
- check(" ", 0)
-}