# Tests that list.UniqueItems correctly rejects lists with duplicate
# values, which were silently passed through instead of producing an error.
# https://cuelang.org/issue/299
-- in.cue --
import "list"

x: list.UniqueItems
x: [string, ...string]
x: ["x", "x"] @test(err, code=eval, contains="does not satisfy list.UniqueItems", pos=[-2:4, -1:4, 0:4])
-- out/eval/stats --
Leaks:  0
Freed:  4
Reused: 0
Allocs: 4
Retain: 0

Unifications: 4
Conjuncts:    9
Disjuncts:    0

NumCloseIDs: 1
-- out/errors.txt --
[eval] x: invalid value ["x","x"] (does not satisfy list.UniqueItems): equal value ("x") at position 0 and 1:
    ./in.cue:3:4
    ./in.cue:4:4
    ./in.cue:5:4
