Files
remark42/backend/app/templates/templates_test.go
T
Dmitry Verkhoturov 86d059bf99 move templates from rakyll/statik to go:embed
There is no need for the rakyll/statik package starting with Go 1.16,
which provides us with tools for embedding files
without third-party libraries.
2022-07-29 19:07:49 +02:00

18 lines
326 B
Go

package templates
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Read(t *testing.T) {
file, err := Read("testdata/template.html.tmpl")
assert.NoError(t, err)
assert.Equal(t, []byte("template\n"), file)
file, err = Read("testdata/bad_path.html.tmpl")
assert.Error(t, err)
assert.Nil(t, file)
}