diff options
author | bnewbold <bnewbold@robocracy.org> | 2012-04-10 20:58:13 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2012-04-11 10:58:08 -0400 |
commit | 78b207a40436d0c15a2b806171914d802cd20661 (patch) | |
tree | 730d02b32e5d54b2512a319d7ced34ad8ce3aacf /util_test.go | |
parent | 3c7a4451e62d27bbe9dc8eb2c16e2ff5607d1b04 (diff) | |
download | bommom-78b207a40436d0c15a2b806171914d802cd20661.tar.gz bommom-78b207a40436d0c15a2b806171914d802cd20661.zip |
tests passing
Diffstat (limited to 'util_test.go')
-rw-r--r-- | util_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
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) + } + } +} |