open-nomad/api/constraint_test.go

22 lines
395 B
Go
Raw Normal View History

2015-09-09 20:02:39 +00:00
package api
import (
"reflect"
"testing"
"github.com/hashicorp/nomad/api/internal/testutil"
2015-09-09 20:02:39 +00:00
)
func TestCompose_Constraints(t *testing.T) {
testutil.Parallel(t)
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)
}
}