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 3729

Issue #3729

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

+488 -7
+488 -7
cue/testdata/comprehensions/pushdown.txtar
··· 871 871 people: bob: name: "Bob" 872 872 } 873 873 } 874 + -- issue3729.cue -- 875 + issue3729: withDisjunction: { 876 + #Root: sub1?: #sub2?: bool 877 + root?: null | #Root 878 + if true { 879 + root: sub1?: #sub2: true 880 + } 881 + } 882 + issue3729: withoutDisjunction: { 883 + root?: null 884 + if true { 885 + root: #sub1?: #sub2: true 886 + } 887 + } 888 + issue3729: withoutDisjunctionWithEmbed: { 889 + root?: null 890 + if true { 891 + root: {_, #sub1?: #sub2: true} 892 + } 893 + } 894 + issue3729: definitionsOnly: { 895 + #Root: #sub1?: #sub2?: bool 896 + root?: null | #Root 897 + if true { 898 + root: #sub1?: #sub2: true 899 + } 900 + } 901 + issue3729: withEmbed: incomplete: { 902 + #Root: #sub1?: #sub2?: bool 903 + root?: null | #Root 904 + if true { 905 + root: {_, #sub1?: #sub2: true} 906 + } 907 + } 908 + issue3729: full: { 909 + #Application: spec: #ApplicationSpec 910 + #ApplicationSpec: syncPolicy?: null | #SyncPolicy 911 + #SyncPolicy: automated?: null | #SyncPolicyAutomated 912 + #SyncPolicyAutomated: { 913 + prune?: bool 914 + selfHeal?: bool 915 + } 916 + argoApp: #Application & { 917 + spec: { 918 + if true { 919 + syncPolicy: automated: { 920 + prune: true 921 + selfHeal: true 922 + } 923 + } 924 + } 925 + } 926 + argoApp: spec: _syncpolicy: "selfhealprune" 927 + } 874 928 -- out/evalalpha -- 875 929 Errors: 876 930 embed.fail1.p: field not allowed: ··· 1598 1652 } 1599 1653 } 1600 1654 } 1655 + issue3729: (struct){ 1656 + withDisjunction: (struct){ 1657 + #Root: (#struct){ 1658 + sub1?: (#struct){ 1659 + #sub2?: (bool){ bool } 1660 + } 1661 + } 1662 + root: ((null|struct)){ |((null){ null }, (#struct){ 1663 + sub1?: (#struct){ 1664 + #sub2: (bool){ true } 1665 + } 1666 + }) } 1667 + } 1668 + withoutDisjunction: (struct){ 1669 + root: (null){ 1670 + null 1671 + #sub1?: (#struct){ 1672 + #sub2: (bool){ true } 1673 + } 1674 + } 1675 + } 1676 + withoutDisjunctionWithEmbed: (struct){ 1677 + root: (null){ 1678 + null 1679 + #sub1?: (#struct){ 1680 + #sub2: (bool){ true } 1681 + } 1682 + } 1683 + } 1684 + definitionsOnly: (struct){ 1685 + #Root: (#struct){ 1686 + #sub1?: (#struct){ 1687 + #sub2?: (bool){ bool } 1688 + } 1689 + } 1690 + root: ((null|struct)){ |((null){ null }, (#struct){ 1691 + #sub1?: (#struct){ 1692 + #sub2: (bool){ true } 1693 + } 1694 + }) } 1695 + } 1696 + withEmbed: (struct){ 1697 + incomplete: (struct){ 1698 + #Root: (#struct){ 1699 + #sub1?: (#struct){ 1700 + #sub2?: (bool){ bool } 1701 + } 1702 + } 1703 + root: ((null|struct)){ |((null){ null }, (#struct){ 1704 + #sub1?: (#struct){ 1705 + #sub2: (bool){ true } 1706 + } 1707 + }) } 1708 + } 1709 + } 1710 + full: (struct){ 1711 + #Application: (#struct){ 1712 + spec: ~(issue3729.full.#ApplicationSpec) 1713 + } 1714 + #ApplicationSpec: (#struct){ 1715 + syncPolicy?: ((null|struct)){ |((null){ null }, (#struct){ 1716 + automated?: ((null|struct)){ |((null){ null }, (#struct){ 1717 + prune?: (bool){ bool } 1718 + selfHeal?: (bool){ bool } 1719 + }) } 1720 + }) } 1721 + } 1722 + #SyncPolicy: (#struct){ 1723 + automated?: ((null|struct)){ |((null){ null }, (#struct){ 1724 + prune?: (bool){ bool } 1725 + selfHeal?: (bool){ bool } 1726 + }) } 1727 + } 1728 + #SyncPolicyAutomated: (#struct){ 1729 + prune?: (bool){ bool } 1730 + selfHeal?: (bool){ bool } 1731 + } 1732 + argoApp: (#struct){ 1733 + spec: (#struct){ 1734 + syncPolicy: ((null|struct)){ |((null){ null }, (#struct){ 1735 + automated: (#struct){ 1736 + prune: (bool){ true } 1737 + selfHeal: (bool){ true } 1738 + } 1739 + }) } 1740 + _syncpolicy: (string){ "selfhealprune" } 1741 + } 1742 + } 1743 + } 1744 + } 1601 1745 unifyDynamicReflectSuccess: (struct){ 1602 1746 X: (struct){ 1603 1747 X: (struct){ ··· 1942 2086 } 1943 2087 } 1944 2088 } 2089 + @@ -800,12 +731,7 @@ 2090 + #sub2?: (bool){ bool } 2091 + } 2092 + } 2093 + - root: ((null|struct)){ |((null){ 2094 + - null 2095 + - sub1?: (struct){ 2096 + - #sub2: (bool){ true } 2097 + - } 2098 + - }, (#struct){ 2099 + + root: ((null|struct)){ |((null){ null }, (#struct){ 2100 + sub1?: (#struct){ 2101 + #sub2: (bool){ true } 2102 + } 2103 + @@ -833,12 +759,7 @@ 2104 + #sub2?: (bool){ bool } 2105 + } 2106 + } 2107 + - root: ((null|struct)){ |((null){ 2108 + - null 2109 + - #sub1?: (#struct){ 2110 + - #sub2: (bool){ true } 2111 + - } 2112 + - }, (#struct){ 2113 + + root: ((null|struct)){ |((null){ null }, (#struct){ 2114 + #sub1?: (#struct){ 2115 + #sub2: (bool){ true } 2116 + } 2117 + @@ -851,12 +772,7 @@ 2118 + #sub2?: (bool){ bool } 2119 + } 2120 + } 2121 + - root: ((null|struct)){ |((null){ 2122 + - null 2123 + - #sub1?: (#struct){ 2124 + - #sub2: (bool){ true } 2125 + - } 2126 + - }, (#struct){ 2127 + + root: ((null|struct)){ |((null){ null }, (#struct){ 2128 + #sub1?: (#struct){ 2129 + #sub2: (bool){ true } 2130 + } 2131 + @@ -865,14 +781,7 @@ 2132 + } 2133 + full: (struct){ 2134 + #Application: (#struct){ 2135 + - spec: (#struct){ 2136 + - syncPolicy?: ((null|struct)){ |((null){ null }, (#struct){ 2137 + - automated?: ((null|struct)){ |((null){ null }, (#struct){ 2138 + - prune?: (bool){ bool } 2139 + - selfHeal?: (bool){ bool } 2140 + - }) } 2141 + - }) } 2142 + - } 2143 + + spec: ~(issue3729.full.#ApplicationSpec) 2144 + } 2145 + #ApplicationSpec: (#struct){ 2146 + syncPolicy?: ((null|struct)){ |((null){ null }, (#struct){ 2147 + @@ -894,12 +803,12 @@ 2148 + } 2149 + argoApp: (#struct){ 2150 + spec: (#struct){ 2151 + - syncPolicy: (#struct){ 2152 + - automated: (#struct){ 2153 + - prune: (bool){ true } 2154 + - selfHeal: (bool){ true } 2155 + - } 2156 + - } 2157 + + syncPolicy: ((null|struct)){ |((null){ null }, (#struct){ 2158 + + automated: (#struct){ 2159 + + prune: (bool){ true } 2160 + + selfHeal: (bool){ true } 2161 + + } 2162 + + }) } 2163 + _syncpolicy: (string){ "selfhealprune" } 2164 + } 2165 + } 2166 + -- out/evalalpha/stats -- 2167 + Leaks: 620 2168 + Freed: 0 2169 + Reused: 0 2170 + Allocs: 620 2171 + Retain: 0 2172 + 2173 + Unifications: 570 2174 + Conjuncts: 943 2175 + Disjuncts: 28 2176 + -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 2177 + diff old new 2178 + --- old 2179 + +++ new 2180 + @@ -1,9 +1,9 @@ 2181 + -Leaks: 17 2182 + -Freed: 564 2183 + -Reused: 551 2184 + -Allocs: 30 2185 + -Retain: 107 2186 + +Leaks: 620 2187 + +Freed: 0 2188 + +Reused: 0 2189 + +Allocs: 620 2190 + +Retain: 0 2191 + 2192 + -Unifications: 545 2193 + -Conjuncts: 870 2194 + -Disjuncts: 641 2195 + +Unifications: 570 2196 + +Conjuncts: 943 2197 + +Disjuncts: 28 1945 2198 -- out/eval/stats -- 1946 2199 Leaks: 17 1947 - Freed: 476 1948 - Reused: 469 1949 - Allocs: 24 1950 - Retain: 104 2200 + Freed: 564 2201 + Reused: 551 2202 + Allocs: 30 2203 + Retain: 107 1951 2204 1952 - Unifications: 477 1953 - Conjuncts: 756 1954 - Disjuncts: 550 2205 + Unifications: 545 2206 + Conjuncts: 870 2207 + Disjuncts: 641 1955 2208 -- diff/todo/p2 -- 1956 2209 provideIncompleteSuccess.t2.a.c.d: missing error: probably correct. 1957 2210 A bit esoteric, but should probably work. ··· 2751 3004 bob: (struct){ 2752 3005 name: (string){ "Bob" } 2753 3006 kind: (string){ "person" } 3007 + } 3008 + } 3009 + } 3010 + issue3729: (struct){ 3011 + withDisjunction: (struct){ 3012 + #Root: (#struct){ 3013 + sub1?: (#struct){ 3014 + #sub2?: (bool){ bool } 3015 + } 3016 + } 3017 + root: ((null|struct)){ |((null){ 3018 + null 3019 + sub1?: (struct){ 3020 + #sub2: (bool){ true } 3021 + } 3022 + }, (#struct){ 3023 + sub1?: (#struct){ 3024 + #sub2: (bool){ true } 3025 + } 3026 + }) } 3027 + } 3028 + withoutDisjunction: (struct){ 3029 + root: (null){ 3030 + null 3031 + #sub1?: (#struct){ 3032 + #sub2: (bool){ true } 3033 + } 3034 + } 3035 + } 3036 + withoutDisjunctionWithEmbed: (struct){ 3037 + root: (null){ 3038 + null 3039 + #sub1?: (#struct){ 3040 + #sub2: (bool){ true } 3041 + } 3042 + } 3043 + } 3044 + definitionsOnly: (struct){ 3045 + #Root: (#struct){ 3046 + #sub1?: (#struct){ 3047 + #sub2?: (bool){ bool } 3048 + } 3049 + } 3050 + root: ((null|struct)){ |((null){ 3051 + null 3052 + #sub1?: (#struct){ 3053 + #sub2: (bool){ true } 3054 + } 3055 + }, (#struct){ 3056 + #sub1?: (#struct){ 3057 + #sub2: (bool){ true } 3058 + } 3059 + }) } 3060 + } 3061 + withEmbed: (struct){ 3062 + incomplete: (struct){ 3063 + #Root: (#struct){ 3064 + #sub1?: (#struct){ 3065 + #sub2?: (bool){ bool } 3066 + } 3067 + } 3068 + root: ((null|struct)){ |((null){ 3069 + null 3070 + #sub1?: (#struct){ 3071 + #sub2: (bool){ true } 3072 + } 3073 + }, (#struct){ 3074 + #sub1?: (#struct){ 3075 + #sub2: (bool){ true } 3076 + } 3077 + }) } 3078 + } 3079 + } 3080 + full: (struct){ 3081 + #Application: (#struct){ 3082 + spec: (#struct){ 3083 + syncPolicy?: ((null|struct)){ |((null){ null }, (#struct){ 3084 + automated?: ((null|struct)){ |((null){ null }, (#struct){ 3085 + prune?: (bool){ bool } 3086 + selfHeal?: (bool){ bool } 3087 + }) } 3088 + }) } 3089 + } 3090 + } 3091 + #ApplicationSpec: (#struct){ 3092 + syncPolicy?: ((null|struct)){ |((null){ null }, (#struct){ 3093 + automated?: ((null|struct)){ |((null){ null }, (#struct){ 3094 + prune?: (bool){ bool } 3095 + selfHeal?: (bool){ bool } 3096 + }) } 3097 + }) } 3098 + } 3099 + #SyncPolicy: (#struct){ 3100 + automated?: ((null|struct)){ |((null){ null }, (#struct){ 3101 + prune?: (bool){ bool } 3102 + selfHeal?: (bool){ bool } 3103 + }) } 3104 + } 3105 + #SyncPolicyAutomated: (#struct){ 3106 + prune?: (bool){ bool } 3107 + selfHeal?: (bool){ bool } 3108 + } 3109 + argoApp: (#struct){ 3110 + spec: (#struct){ 3111 + syncPolicy: (#struct){ 3112 + automated: (#struct){ 3113 + prune: (bool){ true } 3114 + selfHeal: (bool){ true } 3115 + } 3116 + } 3117 + _syncpolicy: (string){ "selfhealprune" } 3118 + } 2754 3119 } 2755 3120 } 2756 3121 } ··· 3823 4188 people: { 3824 4189 bob: { 3825 4190 name: "Bob" 4191 + } 4192 + } 4193 + } 4194 + } 4195 + } 4196 + --- issue3729.cue 4197 + { 4198 + issue3729: { 4199 + withDisjunction: { 4200 + #Root: { 4201 + sub1?: { 4202 + #sub2?: bool 4203 + } 4204 + } 4205 + root?: (null|〈0;#Root〉) 4206 + if true { 4207 + root: { 4208 + sub1?: { 4209 + #sub2: true 4210 + } 4211 + } 4212 + } 4213 + } 4214 + } 4215 + issue3729: { 4216 + withoutDisjunction: { 4217 + root?: null 4218 + if true { 4219 + root: { 4220 + #sub1?: { 4221 + #sub2: true 4222 + } 4223 + } 4224 + } 4225 + } 4226 + } 4227 + issue3729: { 4228 + withoutDisjunctionWithEmbed: { 4229 + root?: null 4230 + if true { 4231 + root: { 4232 + _ 4233 + #sub1?: { 4234 + #sub2: true 4235 + } 4236 + } 4237 + } 4238 + } 4239 + } 4240 + issue3729: { 4241 + definitionsOnly: { 4242 + #Root: { 4243 + #sub1?: { 4244 + #sub2?: bool 4245 + } 4246 + } 4247 + root?: (null|〈0;#Root〉) 4248 + if true { 4249 + root: { 4250 + #sub1?: { 4251 + #sub2: true 4252 + } 4253 + } 4254 + } 4255 + } 4256 + } 4257 + issue3729: { 4258 + withEmbed: { 4259 + incomplete: { 4260 + #Root: { 4261 + #sub1?: { 4262 + #sub2?: bool 4263 + } 4264 + } 4265 + root?: (null|〈0;#Root〉) 4266 + if true { 4267 + root: { 4268 + _ 4269 + #sub1?: { 4270 + #sub2: true 4271 + } 4272 + } 4273 + } 4274 + } 4275 + } 4276 + } 4277 + issue3729: { 4278 + full: { 4279 + #Application: { 4280 + spec: 〈1;#ApplicationSpec〉 4281 + } 4282 + #ApplicationSpec: { 4283 + syncPolicy?: (null|〈1;#SyncPolicy〉) 4284 + } 4285 + #SyncPolicy: { 4286 + automated?: (null|〈1;#SyncPolicyAutomated〉) 4287 + } 4288 + #SyncPolicyAutomated: { 4289 + prune?: bool 4290 + selfHeal?: bool 4291 + } 4292 + argoApp: (〈0;#Application〉 & { 4293 + spec: { 4294 + if true { 4295 + syncPolicy: { 4296 + automated: { 4297 + prune: true 4298 + selfHeal: true 4299 + } 4300 + } 4301 + } 4302 + } 4303 + }) 4304 + argoApp: { 4305 + spec: { 4306 + _syncpolicy: "selfhealprune" 3826 4307 } 3827 4308 } 3828 4309 }