aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
diff options
context:
space:
mode:
authorGravatar Greg Estren <gregce@google.com>2017-02-14 21:30:29 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2017-02-15 10:04:56 +0000
commit564940d73ab135f2dd0573623b8934ed1cd7b9d1 (patch)
treeb886fabd6a057ef9c3d2e75fd2af6cfc9faf0f98 /src/test/java
parentf98361fe0f7af3d549838f940e4af32b73888755 (diff)
Remove type checking requirement from AttributeMap.has.
This overrides the traditional has(String name, Type<>T> type) with has(String name) and removes the type check outright from isConfigurable. Ideally we'd remove the old version in this same change. But there are enough uses of it that that's not a risk-free change and is safer as followup changes. -- PiperOrigin-RevId: 147513593 MOS_MIGRATED_REVID=147513593
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java10
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/select/RawAttributeMapperTest.java8
2 files changed, 7 insertions, 11 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java
index 9ab7b761bc..5cbaf479b7 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java
@@ -22,9 +22,7 @@ import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.packages.Attribute;
import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.Rule;
-import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.util.FileTypeSet;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -104,8 +102,8 @@ public class AspectAwareAttributeMapperTest extends BuildViewTestCase {
@Test
public void isConfigurable() throws Exception {
- assertThat(mapper.isConfigurable("linkstatic", Type.BOOLEAN)).isTrue();
- assertThat(mapper.isConfigurable("fromaspect", BuildType.LABEL_LIST)).isFalse();
+ assertThat(mapper.isConfigurable("linkstatic")).isTrue();
+ assertThat(mapper.isConfigurable("fromaspect")).isFalse();
}
@Test
@@ -128,8 +126,8 @@ public class AspectAwareAttributeMapperTest extends BuildViewTestCase {
@Test
public void has() throws Exception {
- assertThat(mapper.has("srcs", BuildType.LABEL_LIST)).isTrue();
- assertThat(mapper.has("fromaspect", BuildType.LABEL)).isTrue();
+ assertThat(mapper.has("srcs")).isTrue();
+ assertThat(mapper.has("fromaspect")).isTrue();
}
}
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/select/RawAttributeMapperTest.java b/src/test/java/com/google/devtools/build/lib/analysis/select/RawAttributeMapperTest.java
index 16ebc6c87c..04fda2fe81 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/select/RawAttributeMapperTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/select/RawAttributeMapperTest.java
@@ -27,14 +27,12 @@ import com.google.devtools.build.lib.packages.AttributeMap;
import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.RawAttributeMapper;
import com.google.devtools.build.lib.packages.Rule;
-
+import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import java.util.List;
-
/**
* Unit tests for {@link RawAttributeMapper}.
*/
@@ -89,8 +87,8 @@ public class RawAttributeMapperTest extends AbstractAttributeMapperTest {
@Test
public void testConfigurabilityCheck() throws Exception {
RawAttributeMapper rawMapper = RawAttributeMapper.of(setupGenRule());
- assertFalse(rawMapper.isConfigurable("data", BuildType.LABEL_LIST));
- assertTrue(rawMapper.isConfigurable("srcs", BuildType.LABEL_LIST));
+ assertFalse(rawMapper.isConfigurable("data"));
+ assertTrue(rawMapper.isConfigurable("srcs"));
}
/**