open-nomad/api/constraint_test.go
2017-07-21 16:33:04 -07:00

20 lines
334 B
Go

package api
import (
"reflect"
"testing"
)
func TestCompose_Constraints(t *testing.T) {
t.Parallel()
c := NewConstraint("kernel.name", "=", "darwin")
expect := &Constraint{
LTarget: "kernel.name",
RTarget: "darwin",
Operand: "=",
}
if !reflect.DeepEqual(c, expect) {
t.Fatalf("expect: %#v, got: %#v", expect, c)
}
}