all repos — gomponents @ f9d584c9889276000171046bcc2e32177514f552

HTML components in pure Go

Make NodeFunc and attr implement fmt.Stringer (#6)

Markus Wüstenberg
commit

f9d584c9889276000171046bcc2e32177514f552

parent

e8faab5207e6ed48aef0a6b1ade710dd8fbfadd3

1 file changed, 15 insertions(+), 0 deletions(-)

changed files
A assert/assert.go
@@ -0,0 +1,15 @@
+package assert + +import ( + "testing" + + g "github.com/maragudk/gomponents" +) + +// Equal checks for equality between the given expected string and the rendered Node string. +func Equal(t *testing.T, expected string, actual g.Node) { + if expected != actual.Render() { + t.Errorf("expected `%v` but got `%v`", expected, actual) + t.FailNow() + } +}