open-nomad/api/constraint_test.go

19 lines
320 B
Go

package api
import (
"reflect"
"testing"
)
func TestCompose_Constraints(t *testing.T) {
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)
}
}