this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add tests for issue 3919

Issue #3919

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ibb70a600a7683ed5189cec98804add4336054e0e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214949
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+115
+115
cue/testdata/eval/issue3919.txtar
··· 1 + -- in.cue -- 2 + import "math" 3 + 4 + full: { 5 + out: { 6 + env: { 7 + if true { 8 + PORT: math.Abs(out.port) 9 + } 10 + } 11 + if true { 12 + port: int | *30080 13 + } 14 + } 15 + } 16 + reduced: { 17 + if true { 18 + a: math.Abs(port) 19 + } 20 + port: int | *30080 21 + } 22 + -- out/eval/stats -- 23 + Leaks: 0 24 + Freed: 13 25 + Reused: 5 26 + Allocs: 8 27 + Retain: 0 28 + 29 + Unifications: 9 30 + Conjuncts: 13 31 + Disjuncts: 13 32 + -- out/evalalpha -- 33 + (struct){ 34 + full: (struct){ 35 + out: (struct){ 36 + env: (struct){ 37 + PORT: (_|_){ 38 + // [incomplete] full.out.env.PORT: error in call to math.Abs: non-concrete value _: 39 + // ./in.cue:7:11 40 + } 41 + } 42 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 43 + } 44 + } 45 + reduced: (struct){ 46 + a: (_|_){ 47 + // [incomplete] reduced.a: error in call to math.Abs: non-concrete value _: 48 + // ./in.cue:17:6 49 + } 50 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 51 + } 52 + } 53 + -- diff/-out/evalalpha<==>+out/eval -- 54 + diff old new 55 + --- old 56 + +++ new 57 + @@ -2,13 +2,19 @@ 58 + full: (struct){ 59 + out: (struct){ 60 + env: (struct){ 61 + - PORT: (int){ 30080 } 62 + + PORT: (_|_){ 63 + + // [incomplete] full.out.env.PORT: error in call to math.Abs: non-concrete value _: 64 + + // ./in.cue:7:11 65 + + } 66 + } 67 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 68 + } 69 + } 70 + reduced: (struct){ 71 + - a: (int){ 30080 } 72 + + a: (_|_){ 73 + + // [incomplete] reduced.a: error in call to math.Abs: non-concrete value _: 74 + + // ./in.cue:17:6 75 + + } 76 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 77 + } 78 + } 79 + -- out/eval -- 80 + (struct){ 81 + full: (struct){ 82 + out: (struct){ 83 + env: (struct){ 84 + PORT: (int){ 30080 } 85 + } 86 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 87 + } 88 + } 89 + reduced: (struct){ 90 + a: (int){ 30080 } 91 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 92 + } 93 + } 94 + -- out/compile -- 95 + --- in.cue 96 + { 97 + full: { 98 + out: { 99 + env: { 100 + if true { 101 + PORT: 〈import;math〉.Abs(〈3;out〉.port) 102 + } 103 + } 104 + if true { 105 + port: (int|*30080) 106 + } 107 + } 108 + } 109 + reduced: { 110 + if true { 111 + a: 〈import;math〉.Abs(〈1;port〉) 112 + } 113 + port: (int|*30080) 114 + } 115 + }