summaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
authorMatthias Loibl <mail@matthiasloibl.com>2016-11-07 23:15:02 +0100
committerMatthias Loibl <mail@matthiasloibl.com>2016-11-07 23:31:40 +0100
commite74868a8508eb7069c62f3cf71bbd71184985d1f (patch)
treec70520ce6ad71d717df90c9982460759eebc6b46 /modules/base/tool_test.go
parent95d4cd9292454dccaa8bd443656a7f21e18dccc5 (diff)
downloadgitea-e74868a8508eb7069c62f3cf71bbd71184985d1f.tar.gz
gitea-e74868a8508eb7069c62f3cf71bbd71184985d1f.zip
Add test for IsTextFile()
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index 4f64d3728d..093e479a38 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -176,6 +176,10 @@ func TestIsLetter(t *testing.T) {
assert.False(t, IsLetter('$'))
}
-// TODO: IsTextFile()
-// TODO: IsImageFile()
-// TODO: IsPDFFile()
+func TestIsTextFile(t *testing.T) {
+ assert.True(t, IsTextFile([]byte{}))
+ assert.True(t, IsTextFile([]byte("lorem ipsum")))
+}
+
+// TODO: IsImageFile(), currently no idea how to test
+// TODO: IsPDFFile(), currently no idea how to test