open-nomad/helper/fields/schema_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
385 B
Go
Raw Normal View History

package fields
import "testing"
func TestFieldSchemaDefaultOrZero(t *testing.T) {
fs := &FieldSchema{
Type: TypeString,
Default: "default",
}
if d := fs.DefaultOrZero(); d != "default" {
t.Fatalf("bad: Expected: default Got: %s", d)
}
fs = &FieldSchema{
Type: TypeString,
}
if d := fs.DefaultOrZero(); d != "" {
t.Fatalf("bad: Expected: \"\" Got: %s", d)
}
}