diff options
author | Matthias Loibl <mail@matthiasloibl.com> | 2016-11-07 23:15:02 +0100 |
---|---|---|
committer | Matthias Loibl <mail@matthiasloibl.com> | 2016-11-07 23:31:40 +0100 |
commit | e74868a8508eb7069c62f3cf71bbd71184985d1f (patch) | |
tree | c70520ce6ad71d717df90c9982460759eebc6b46 /modules/base | |
parent | 95d4cd9292454dccaa8bd443656a7f21e18dccc5 (diff) | |
download | gitea-e74868a8508eb7069c62f3cf71bbd71184985d1f.tar.gz gitea-e74868a8508eb7069c62f3cf71bbd71184985d1f.zip |
Add test for IsTextFile()
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/tool_test.go | 10 |
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 |