2015-09-09 20:02:39 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
"testing"
|
2022-03-17 13:34:57 +00:00
|
|
|
|
|
|
|
"github.com/hashicorp/nomad/api/internal/testutil"
|
2015-09-09 20:02:39 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCompose_Constraints(t *testing.T) {
|
2022-03-17 13:34:57 +00:00
|
|
|
testutil.Parallel(t)
|
2015-10-27 21:31:14 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|