summaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
authorMatthias Loibl <mail@matthiasloibl.com>2016-11-07 22:44:25 +0100
committerMatthias Loibl <mail@matthiasloibl.com>2016-11-07 23:31:40 +0100
commit2bb188ae79cd6621dad17676a20ef04731f92071 (patch)
tree5937a2e7d6532db13454220bd25ebac94ad42e54 /modules/base/tool_test.go
parent4235fff9eee14e91d0587b03fac64980047660bf (diff)
downloadgitea-2bb188ae79cd6621dad17676a20ef04731f92071.tar.gz
gitea-2bb188ae79cd6621dad17676a20ef04731f92071.zip
Add test for IsLetter()
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index 052a2f0dec..4f64d3728d 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -161,7 +161,21 @@ func TestInt64sToMap(t *testing.T) {
)
}
-// TODO: IsLetter()
+func TestIsLetter(t *testing.T) {
+ assert.True(t, IsLetter('a'))
+ assert.True(t, IsLetter('e'))
+ assert.True(t, IsLetter('q'))
+ assert.True(t, IsLetter('z'))
+ assert.True(t, IsLetter('A'))
+ assert.True(t, IsLetter('E'))
+ assert.True(t, IsLetter('Q'))
+ assert.True(t, IsLetter('Z'))
+ assert.True(t, IsLetter('_'))
+ assert.False(t, IsLetter('-'))
+ assert.False(t, IsLetter('1'))
+ assert.False(t, IsLetter('$'))
+}
+
// TODO: IsTextFile()
// TODO: IsImageFile()
// TODO: IsPDFFile()