2019-05-30 03:33:30 +00:00
|
|
|
package attribute_test
|
|
|
|
|
|
|
|
import (
|
2019-05-30 03:42:48 +00:00
|
|
|
"testing"
|
2019-05-30 03:33:30 +00:00
|
|
|
|
2019-05-30 03:42:48 +00:00
|
|
|
"gitlab.codemonkeysoftware.net/b/hatmill"
|
|
|
|
"gitlab.codemonkeysoftware.net/b/hatmill/attribute"
|
2019-05-30 03:33:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func testAttribValue(t *testing.T, attrib hatmill.Attrib, expectedValue string) {
|
2019-05-30 03:42:48 +00:00
|
|
|
t.Helper()
|
2019-08-31 15:05:43 +00:00
|
|
|
if attrib.ValueString() != expectedValue {
|
|
|
|
t.Fatalf("expected attribute value to be %#v, but got %#v", expectedValue, attrib.ValueString())
|
2019-05-30 03:42:48 +00:00
|
|
|
}
|
2019-05-30 03:33:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBool(t *testing.T) {
|
2019-05-30 03:42:48 +00:00
|
|
|
testAttribValue(t, attribute.Disabled(), "")
|
2019-05-30 03:33:30 +00:00
|
|
|
}
|