aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar vladmos <vladmos@google.com>2017-09-01 19:52:06 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-09-01 20:08:38 +0200
commit663df9d96f10a2dd0fa8a85b4aac39cd2cc368fb (patch)
treece6e4fe5640a24d8533dac347dd7a4c5591a84db
parent8fb7d538db6a32fb969ce744579ea3b599fbf87b (diff)
Remove testFunctionListArgumentsAreImmutable and testFunctionDictArgumentsAreImmutable
These tests don't actually check mutability of objects but behavior of += on them. Input arguments of functions are in fact mutable unless they've been created in another mutability scope. There are already other tests that actually check immutability of objects from another mutability scope. PiperOrigin-RevId: 167295711
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java b/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java
index f7dd0ccb8e..cf70b0e72d 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java
@@ -15,7 +15,6 @@ package com.google.devtools.build.lib.syntax;
import static com.google.common.truth.Truth.assertThat;
-import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.syntax.util.EvaluationTestCase;
import java.util.ArrayList;
import java.util.List;
@@ -223,25 +222,6 @@ public class FunctionTest extends EvaluationTestCase {
assertThat(lookup("a")).isEqualTo(2);
}
- @SuppressWarnings("unchecked")
- @Test
- public void testFunctionListArgumentsAreImmutable() throws Exception {
- eval("l = [1]",
- "def func(l):",
- " l += [2]",
- "func(l)");
- assertThat((Iterable<Object>) lookup("l")).containsExactly(1);
- }
-
- @Test
- public void testFunctionDictArgumentsAreImmutable() throws Exception {
- eval("d = {'a' : 1}",
- "def func(d):",
- " d += {'a' : 2}",
- "func(d)");
- assertThat(lookup("d")).isEqualTo(ImmutableMap.of("a", 1));
- }
-
@Test
public void testFunctionNameAliasing() throws Exception {
eval("def func(a):",