aboutsummaryrefslogtreecommitdiff
path: root/func_test.go
diff options
context:
space:
mode:
authorFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-06-10 14:56:49 +0900
committerFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-06-10 14:58:44 +0900
commit76b609ea4989d058a62bb6888a90430cc0bd9342 (patch)
tree1db6943f8ad0749ba9d0dfdc8ad26cb7f1b057c0 /func_test.go
parentb69bf8a7ac05ad382c588c0c40fe416c92e697be (diff)
downloadkati-76b609ea4989d058a62bb6888a90430cc0bd9342.tar.gz
android rot13
before: $ ./repo/android.sh kati -c -use_find_cache -kati_stats *kati*: eval time: "34.677942345s" *kati*: shell func time: "13.71144088s" 559 *kati*: dep build prepare time: "213.586963ms" *kati*: 52737 variables *kati*: 78461 explicit rules *kati*: 0 implicit rules *kati*: 1 suffix rules *kati*: dep build time: "2.016057014s" ./repo/android.sh kati -c -use_find_cache -kati_stats 36.32s user 22.01s system 157% cpu 37.023 total after: $ ./repo/android.sh kati -c -use_find_cache -kati_stats *kati*: eval time: "30.99209655s" *kati*: shell func time: "10.133065433s" 385 *kati*: dep build prepare time: "236.542165ms" *kati*: 52737 variables *kati*: 78461 explicit rules *kati*: 0 implicit rules *kati*: 1 suffix rules *kati*: dep build time: "1.880664823s" ./repo/android.sh kati -c -use_find_cache -kati_stats 36.65s user 18.09s system 164% cpu 33.218 total
Diffstat (limited to 'func_test.go')
-rw-r--r--func_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/func_test.go b/func_test.go
new file mode 100644
index 0000000..e438b88
--- /dev/null
+++ b/func_test.go
@@ -0,0 +1,39 @@
+// 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 "testing"
+
+func TestRot13(t *testing.T) {
+ for _, tc := range []struct {
+ in string
+ want string
+ }{
+ {
+ in: "PRODUCT_PACKAGE_OVERLAYS",
+ want: "CEBQHPG_CNPXNTR_BIREYNLF",
+ },
+ {
+ in: "product_name",
+ want: "cebqhpg_anzr",
+ },
+ } {
+ buf := []byte(tc.in)
+ rot13(buf)
+ if got, want := string(buf), tc.want; got != want {
+ t.Errorf("rot13(%q) got=%q; want=%q", tc.in, got, want)
+ }
+ }
+}