-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: add tests for Issue 3584
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
Showing
1 changed file
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} | ||
} |