Simplified TestBool

This commit is contained in:
Brandon Dyck 2019-08-31 13:10:29 -06:00
parent ee6d5468d1
commit e3cedf5de7

View File

@ -1,19 +1,13 @@
package attribute_test
import (
"testing"
"gitlab.codemonkeysoftware.net/b/hatmill"
"gitlab.codemonkeysoftware.net/b/hatmill/attribute"
"testing"
)
func testAttribValue(t *testing.T, attrib hatmill.Attrib, expectedValue string) {
t.Helper()
if attrib.ValueString() != expectedValue {
t.Fatalf("expected attribute value to be %#v, but got %#v", expectedValue, attrib.ValueString())
func TestBool(t *testing.T) {
attrib := attribute.Disabled()
if attrib.Value != nil {
t.Fatalf("expected attribute value to be nil, but got %#v", attrib.Value)
}
}
func TestBool(t *testing.T) {
testAttribValue(t, attribute.Disabled(), "")
}