aboutsummaryrefslogtreecommitdiff
path: root/func_test.go
diff options
context:
space:
mode:
authorFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-06-19 10:17:48 +0900
committerFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-06-19 10:57:02 +0900
commitcc8d0cd2fcb2b46133653f97b3f99640bd095fa4 (patch)
tree7fc278ff9568133b7bf2e71748ddb8bf82d1c284 /func_test.go
parentb60f91f9fad8aaab945aabc39cdedc471d04d12a (diff)
downloadkati-cc8d0cd2fcb2b46133653f97b3f99640bd095fa4.tar.gz
WIP
Diffstat (limited to 'func_test.go')
-rw-r--r--func_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/func_test.go b/func_test.go
new file mode 100644
index 0000000..7778125
--- /dev/null
+++ b/func_test.go
@@ -0,0 +1,37 @@
+// Copyright 2015 Google Inc. All rights reserved
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package main
+
+import (
+ "bytes"
+ "testing"
+)
+
+func BenchmarkFuncStrip(b *testing.B) {
+ strip := &funcStrip{
+ fclosure: fclosure{
+ args: []Value{
+ literal("(strip"),
+ literal("a b c "),
+ },
+ },
+ }
+ ev := newEvaluator(make(map[string]Var))
+ var buf bytes.Buffer
+ for i := 0; i < b.N; i++ {
+ buf.Reset()
+ strip.Eval(&buf, ev)
+ }
+}