open-nomad/api/constraint_test.go

20 lines
334 B
Go
Raw Normal View History

2015-09-09 20:02:39 +00:00
package api
import (
"reflect"
"testing"
)
func TestCompose_Constraints(t *testing.T) {
2017-07-21 23:33:04 +00:00
t.Parallel()
c := NewConstraint("kernel.name", "=", "darwin")
2015-09-09 20:02:39 +00:00
expect := &Constraint{
LTarget: "kernel.name",
RTarget: "darwin",
Operand: "=",
}
if !reflect.DeepEqual(c, expect) {
t.Fatalf("expect: %#v, got: %#v", expect, c)
}
}