Simplified TestBool
This commit is contained in:
parent
ee6d5468d1
commit
e3cedf5de7
@ -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(), "")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user