hatmill/attribute/generated_test.go
2019-08-31 10:30:17 -06:00

25 lines
561 B
Go

package attribute_test
import (
"testing"
"gitlab.codemonkeysoftware.net/b/hatmill"
"gitlab.codemonkeysoftware.net/b/hatmill/attribute"
)
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 TestString(t *testing.T) {
const s = "abcdefg"
testAttribValue(t, attribute.Id(s), s)
}
func TestBool(t *testing.T) {
testAttribValue(t, attribute.Disabled(), "")
}