Skip to content

Commit

Permalink
internal/core/eval: verify issue 299 if fixed
Browse files Browse the repository at this point in the history
Fixes #299

Change-Id: I3a45b40b6273294185e8ba99bbfd61dfb9422d65
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/7046
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Sep 12, 2020
1 parent ddd99d5 commit 480e1a1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions cue/testdata/builtins/issue299.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- in.cue --
import "list"
x: list.UniqueItems
x: [string, ...string]
x: ["x","x"]
-- out/eval --
Errors:
x: invalid value ["x","x"] (does not satisfy list.UniqueItems)

Result:
(_|_){
// [eval]
x: (_|_){
// [eval] x: invalid value ["x","x"] (does not satisfy list.UniqueItems)
0: (string){ "x" }
1: (string){ "x" }
}
}
-- out/compile --
--- in.cue
{
x: 〈import;list〉.UniqueItems
x: [
string,
...string,
]
x: [
"x",
"x",
]
}

0 comments on commit 480e1a1

Please sign in to comment.