From ddc7bb9064042a0d5da9546eaf6ff888dca63f0c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 14 Aug 2016 01:53:06 +0900 Subject: [perf] Optimize AWK-style tokenizer for --nth Approx. 50% less memory footprint and 40% improvement in query time --- src/util/util_test.go | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/util/util_test.go') 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) -} -- cgit v1.2.3