aboutsummaryrefslogtreecommitdiffstats
path: root/util_test.go
blob: 7a87bdeb8441650965c5e69285ba9819fc698980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)
		}
	}
}