aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
diff options
context:
space:
mode:
authorGravatar vladmos <vladmos@google.com>2017-12-08 03:07:47 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-08 03:09:20 -0800
commitc5301e919c990ab2e87bac9abde003202c966e8a (patch)
tree4267ed4960ad08d6cd8a86da811b555661c82406 /src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
parentc1914135477581163560c00a3a728d37ad0ea846 (diff)
Remove the --incompatible_list_plus_equals_inplace flag
RELNOTES[INC]: The flag --incompatible_list_plus_equals_inplace is removed, its default behavior is preserved. += on lists now always mutates the left hand side. PiperOrigin-RevId: 178359047
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
index c7cc34805d..8aaeb88b00 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
@@ -1074,21 +1074,8 @@ public class SkylarkEvaluationTest extends EvaluationTest {
}
@Test
- public void testPlusEqualsOnListCopying() throws Exception {
- new SkylarkTest("--incompatible_list_plus_equals_inplace=false")
- .setUp(
- "def func():",
- " l1 = [1, 2]",
- " l2 = l1",
- " l2 += [3, 4]",
- " return l1, l2",
- "lists = str(func())")
- .testLookup("lists", "([1, 2], [1, 2, 3, 4])");
- }
-
- @Test
public void testPlusEqualsOnListMutating() throws Exception {
- new SkylarkTest("--incompatible_list_plus_equals_inplace=true")
+ new SkylarkTest()
.setUp(
"def func():",
" l1 = [1, 2]",
@@ -1099,7 +1086,7 @@ public class SkylarkEvaluationTest extends EvaluationTest {
.testLookup("lists", "([1, 2, 3, 4], [1, 2, 3, 4])");
// The same but with += after an IndexExpression
- new SkylarkTest("--incompatible_list_plus_equals_inplace=true")
+ new SkylarkTest()
.setUp(
"def func():",
" l = [1, 2]",
@@ -1112,22 +1099,7 @@ public class SkylarkEvaluationTest extends EvaluationTest {
@Test
public void testPlusEqualsOnTuple() throws Exception {
- new SkylarkTest("--incompatible_list_plus_equals_inplace=false")
- .setUp(
- "def func():",
- " t1 = (1, 2)",
- " t2 = t1",
- " t2 += (3, 4)",
- " return t1, t2",
- "tuples = func()")
- .testLookup("tuples", SkylarkList.Tuple.of(
- SkylarkList.Tuple.of(1, 2),
- SkylarkList.Tuple.of(1, 2, 3, 4)
- ));
-
- // This behavior should remain the same regardless of the
- // --incompatible_list_plus_equals_inplace flag
- new SkylarkTest("--incompatible_list_plus_equals_inplace=true")
+ new SkylarkTest()
.setUp(
"def func():",
" t1 = (1, 2)",