aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java
index 04746bb509..14b26ec218 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java
@@ -483,6 +483,13 @@ public class EvaluationTest extends EvaluationTestCase {
}
@Test
+ public void testDictComprehension_ManyClauses() throws Exception {
+ new SkylarkTest().testStatement(
+ "{x : x * y for x in range(1, 10) if x % 2 == 0 for y in range(1, 10) if y == x}",
+ ImmutableMap.of(2, 4, 4, 16, 6, 36, 8, 64));
+ }
+
+ @Test
public void testDictComprehensions_MultipleKey() throws Exception {
newTest().testStatement("{x : x for x in [1, 2, 1]}", ImmutableMap.of(1, 1, 2, 2))
.testStatement("{y : y for y in ['ab', 'c', 'a' + 'b']}",