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(), "") }