learnlytics-go/templ/generator/test-only-scripts/render_test.go

24 lines
342 B
Go
Raw Normal View History

2025-03-20 12:35:13 +01:00
package onlyscripts
import (
_ "embed"
"testing"
"github.com/a-h/templ/generator/htmldiff"
)
//go:embed expected.html
var expected string
func Test(t *testing.T) {
script := withParameters("hello", "world", 42069)
diff, err := htmldiff.Diff(script, expected)
if err != nil {
t.Fatal(err)
}
if diff != "" {
t.Error(diff)
}
}