diff options
author | bep <bjorn.erik.pedersen@gmail.com> | 2015-01-27 10:15:57 +0100 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-01-27 10:15:57 +0100 |
commit | 5f9596e68c55830d046de3faa88ab0a8f68fcf76 (patch) | |
tree | 14a8979d33e6385f3aa24190a63aa8011b06003f /helpers/content_test.go | |
parent | de76d4a84ef38ed92887ddd78da639000d6e6371 (diff) |
Add more tests to helper
Diffstat (limited to 'helpers/content_test.go')
-rw-r--r-- | helpers/content_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/helpers/content_test.go b/helpers/content_test.go index 18cdfcc5d..63ef82f2f 100644 --- a/helpers/content_test.go +++ b/helpers/content_test.go @@ -1,6 +1,8 @@ package helpers import ( + "github.com/stretchr/testify/assert" + "html/template" "testing" ) @@ -20,3 +22,12 @@ func TestStripHTML(t *testing.T) { } } } + +func TestStripEmptyNav(t *testing.T) { + cleaned := StripEmptyNav([]byte("do<nav>\n</nav>\n\nbedobedo")) + assert.Equal(t, []byte("dobedobedo"), cleaned) +} + +func TestBytesToHTML(t *testing.T) { + assert.Equal(t, template.HTML("dobedobedo"), BytesToHTML([]byte("dobedobedo"))) +} |