all repos — gomponents @ 18b52ffda17b2c2a5b888260f3199fd002162b98

HTML components in pure Go

Add a test for attr.String (#12)

Markus Wüstenberg
commit

18b52ffda17b2c2a5b888260f3199fd002162b98

parent

d78ed7efc7925a7a49cbf939fd45b1b2680a37f4

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

changed files
M gomponents_test.gogomponents_test.go
@@ -2,6 +2,7 @@ package gomponents_test
import ( "errors" + "fmt" "strings" "testing"
@@ -38,6 +39,14 @@ }
}() g.Attr("name", "value", "what is this?") if !called { + t.FailNow() + } + }) + + t.Run("implements fmt.Stringer", func(t *testing.T) { + a := g.Attr("required") + s := fmt.Sprintf("%v", a) + if s != " required" { t.FailNow() } })