Skip to content

Commit

Permalink
internal/core/adt: add tests for Issue 3584
Browse files Browse the repository at this point in the history
Issue #3584

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I8208efd2459a8035dccb1c8749c8ae13eb8e9dba
Dispatch-Trailer: {"type":"trybot","CL":1206320,"patchset":1,"ref":"refs/changes/20/1206320/1","targetBranch":"master"}
  • Loading branch information
mpvl authored and cueckoo committed Dec 24, 2024
1 parent db3a7c9 commit 80708b5
Showing 1 changed file with 117 additions and 0 deletions.
117 changes: 117 additions & 0 deletions cue/testdata/builtins/args.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
-- in.cue --
import (
"math"
"strings"
)

issue3584: reduced: t1: {
ref: out
trigger: *1 | 2
out: strings.SliceRunes("ABC", 0, trigger)
}

issue3584: reduced: t2: {
x: math.Abs(y)
y: *6 | 5
}
-- out/eval/stats --
Leaks: 0
Freed: 14
Reused: 5
Allocs: 9
Retain: 1

Unifications: 10
Conjuncts: 17
Disjuncts: 15
-- out/evalalpha --
(struct){
issue3584: (struct){
reduced: (struct){
t1: (struct){
ref: (_|_){
// [incomplete] issue3584.reduced.t1.out: error in call to strings.SliceRunes: non-concrete value _:
// ./in.cue:9:7
}
trigger: (int){ |(*(int){ 1 }, (int){ 2 }) }
out: (_|_){
// [incomplete] issue3584.reduced.t1.out: error in call to strings.SliceRunes: non-concrete value _:
// ./in.cue:9:7
}
}
t2: (struct){
x: (_|_){
// [incomplete] issue3584.reduced.t2.x: error in call to math.Abs: non-concrete value _:
// ./in.cue:13:5
}
y: (int){ |(*(int){ 6 }, (int){ 5 }) }
}
}
}
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -2,12 +2,21 @@
issue3584: (struct){
reduced: (struct){
t1: (struct){
- ref: (string){ "A" }
+ ref: (_|_){
+ // [incomplete] issue3584.reduced.t1.out: error in call to strings.SliceRunes: non-concrete value _:
+ // ./in.cue:9:7
+ }
trigger: (int){ |(*(int){ 1 }, (int){ 2 }) }
- out: (string){ "A" }
+ out: (_|_){
+ // [incomplete] issue3584.reduced.t1.out: error in call to strings.SliceRunes: non-concrete value _:
+ // ./in.cue:9:7
+ }
}
t2: (struct){
- x: (int){ 6 }
+ x: (_|_){
+ // [incomplete] issue3584.reduced.t2.x: error in call to math.Abs: non-concrete value _:
+ // ./in.cue:13:5
+ }
y: (int){ |(*(int){ 6 }, (int){ 5 }) }
}
}
-- out/eval --
(struct){
issue3584: (struct){
reduced: (struct){
t1: (struct){
ref: (string){ "A" }
trigger: (int){ |(*(int){ 1 }, (int){ 2 }) }
out: (string){ "A" }
}
t2: (struct){
x: (int){ 6 }
y: (int){ |(*(int){ 6 }, (int){ 5 }) }
}
}
}
}
-- out/compile --
--- in.cue
{
issue3584: {
reduced: {
t1: {
ref: 〈0;out〉
trigger: (*1|2)
out: 〈import;strings〉.SliceRunes("ABC", 0, 〈0;trigger〉)
}
}
}
issue3584: {
reduced: {
t2: {
x: 〈import;math〉.Abs(〈0;y〉)
y: (*6|5)
}
}
}
}

0 comments on commit 80708b5

Please sign in to comment.