aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2017-02-09 11:46:11 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2017-02-09 15:11:36 +0000
commit6cec0dec250c6573e17dc219f4a6dd35b53660bc (patch)
tree0c2095f25858c28a56daa9120b78cb6a9ecc616a /src/test/java/com/google/devtools/build/lib/syntax
parentad38353d1466ba4cd02458fde8a58832511a1f96 (diff)
Fix int*list binary operator.
[2] * 3 should return [2, 2, 2] and not [2, 2, 2, 2]. -- PiperOrigin-RevId: 147017581 MOS_MIGRATED_REVID=147017581
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java4
1 files changed, 4 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 8e41974376..db5d95cfe1 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
@@ -538,7 +538,11 @@ public class EvaluationTest extends EvaluationTestCase {
@Test
public void testListMultiply() throws Exception {
newTest()
+ .testStatement("[1, 2, 3] * 1", MutableList.of(env, 1, 2, 3))
.testStatement("[1, 2] * 2", MutableList.of(env, 1, 2, 1, 2))
+ .testStatement("[1, 2] * 3", MutableList.of(env, 1, 2, 1, 2, 1, 2))
+ .testStatement("[1, 2] * 4", MutableList.of(env, 1, 2, 1, 2, 1, 2, 1, 2))
+ .testStatement("[8] * 5", MutableList.of(env, 8, 8, 8, 8, 8))
.testStatement("[ ] * 10", MutableList.EMPTY)
.testStatement("[1, 2] * 0", MutableList.EMPTY)
.testStatement("[1, 2] * -4", MutableList.EMPTY)