open-nomad/api/constraint_test.go

19 lines
320 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) {
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)
}
}