From 78b207a40436d0c15a2b806171914d802cd20661 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 10 Apr 2012 20:58:13 -0400 Subject: tests passing --- util_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 util_test.go (limited to 'util_test.go') diff --git a/util_test.go b/util_test.go new file mode 100644 index 0000000..7a87bde --- /dev/null +++ b/util_test.go @@ -0,0 +1,32 @@ +package main + +import "testing" + +var yesShort = []string{ + "asdf", + "as12df", + "as_df", +} + +var noShort = []string{ + "(!&#$(&@!#", + "_asdf", + "as df", + "ASDF", + "AS_DF", + "2o45", + "as.12df", +} + +func TestIsShortName(t *testing.T) { + for _, y := range yesShort { + if !isShortName(y) { + t.Errorf("Is short: " + y) + } + } + for _, n := range noShort { + if isShortName(n) { + t.Errorf("Is not short: " + n) + } + } +} -- cgit v1.2.3