hatmill/attribute/generated_test.go

25 lines
561 B
Go
Raw Normal View History

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()
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 TestString(t *testing.T) {
2019-05-30 03:42:48 +00:00
const s = "abcdefg"
testAttribValue(t, attribute.Id(s), s)
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
}