some tests and major cleanup

This commit is contained in:
ston1th 2018-10-19 23:08:32 +02:00
commit 16671b3406
30 changed files with 192057 additions and 202431 deletions

29
pkg/render/render_test.go Normal file
View file

@ -0,0 +1,29 @@
// Copyright (C) 2018 Marius Schellenberger
package render
import (
"testing"
)
func TestTitleFunctions(t *testing.T) {
section := "section"
title := "title"
combined := "section/title"
t.Run("StoreTitle", func(t *testing.T) {
if StoreTitle(section, title) != combined {
t.Fail()
}
})
t.Run("UnstoreTitle", func(t *testing.T) {
se, ti := UnstoreTitle(combined)
if se != section || ti != title {
t.Fail()
}
})
t.Run("Title", func(t *testing.T) {
if Title("9ßw$%4h4t-8v74 287(G /SV&3[45v}=94#+?)") != "9w4h4t-8v74+287G+SV345v94" {
t.Fail()
}
})
}