# This file tests disjunctions used as operands.
-- in.cue --
list:      *[1] | [2]      @test(eq, *[1] | [2])
condition: *true | false   @test(eq, *true | false)
num:       *1 | 2          @test(eq, *1 | 2)
object:    *{a: 1} | {a: 2} @test(eq, *{a: 1} | {a: 2})

forLoop: [
	for e in list {
		"count: \(e)"
	},
] @test(eq, ["count: 1"])

conditional: {
	if condition {
		a: 3
	}
	if num < 5 {
		b: 3
	}
	@test(eq, {a: 3, b: 3})
}

selector: {
	a: object.a
	@test(eq, {a: 1})
}

index: {
	a: list[0]
	@test(eq, {a: 1})
}

binOp: {
	a: num + 4
	@test(eq, {a: 5})
}

unaryOp: {
	a: -num
	@test(eq, {a: -1})
}
-- out/eval/stats --
Leaks:  0
Freed:  30
Reused: 15
Allocs: 15
Retain: 0

Unifications: 22
Conjuncts:    33
Disjuncts:    8

NumCloseIDs: 5
