diff options
author | 2015-11-05 19:26:16 +0000 | |
---|---|---|
committer | 2015-11-06 16:39:43 +0000 | |
commit | 7136f6ea1bdcdd6ae1806d4d895662f14bba7731 (patch) | |
tree | 8781f8627fa156cc6e16f9c4eff32e224a18f5be /src/test/java/com/google/devtools | |
parent | 503b784b8fd86ba382ac7b9f4b2bef993a30d353 (diff) |
Remove BuildViewTestCase.assertContainsSublist, and use MoreAsserts.assertContainsSublist instead.
--
MOS_MIGRATED_REVID=107158614
Diffstat (limited to 'src/test/java/com/google/devtools')
3 files changed, 6 insertions, 13 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java index c3e8067344..cfbb3dfa78 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java @@ -34,6 +34,7 @@ import com.google.devtools.build.lib.analysis.util.ActionTester; import com.google.devtools.build.lib.analysis.util.ActionTester.ActionCombinationFactory; import com.google.devtools.build.lib.analysis.util.AnalysisTestUtil; import com.google.devtools.build.lib.analysis.util.BuildViewTestCase; +import com.google.devtools.build.lib.testutil.MoreAsserts; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.Arrays; @@ -166,7 +167,7 @@ public class SpawnActionTest extends BuildViewTestCase { ImmutableList.copyOf( ((ParameterFileWriteAction) getGeneratingAction(paramFile)).getContents())) .containsExactly("-X"); - assertContainsSublist(actionInputsToPaths(action.getSpawn().getInputFiles()), + MoreAsserts.assertContainsSublist(actionInputsToPaths(action.getSpawn().getInputFiles()), "pkg/exe.jar"); } @@ -197,7 +198,7 @@ public class SpawnActionTest extends BuildViewTestCase { assertEquals(Arrays.asList("-X"), ImmutableList.copyOf( ((ParameterFileWriteAction) getGeneratingAction(paramFile)).getContents())); - assertContainsSublist(actionInputsToPaths(action.getSpawn().getInputFiles()), + MoreAsserts.assertContainsSublist(actionInputsToPaths(action.getSpawn().getInputFiles()), "pkg/exe.jar"); } diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java index 939915db53..e4c7b95fad 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java @@ -1146,15 +1146,6 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * sublist. This is useful for checking that a list of arguments contains a * particular set of arguments. */ - protected void assertContainsSublist(List<String> list, String... sublist) { - assertContainsSublist(null, list, Arrays.asList(sublist)); - } - - /** - * Utility method for asserting that a list contains the elements of a - * sublist. This is useful for checking that a list of arguments contains a - * particular set of arguments. - */ protected void assertContainsSublist(List<String> list, List<String> sublist) { assertContainsSublist(null, list, sublist); } diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java index e64e74cfcb..7e5a9ee3e0 100644 --- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java +++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java @@ -39,6 +39,7 @@ import com.google.devtools.build.lib.syntax.SkylarkList.MutableList; import com.google.devtools.build.lib.syntax.SkylarkNestedSet; import com.google.devtools.build.lib.syntax.SkylarkSignature; import com.google.devtools.build.lib.syntax.SkylarkSignature.Param; +import com.google.devtools.build.lib.testutil.MoreAsserts; import java.nio.charset.StandardCharsets; import java.util.List; @@ -215,7 +216,7 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase { ruleContext.getRuleContext().getAnalysisEnvironment().getRegisteredActions()); assertArtifactFilenames(action.getInputs(), "a.txt", "b.img"); assertArtifactFilenames(action.getOutputs(), "a.txt", "b.img"); - assertContainsSublist(action.getArguments(), "-c", "dummy_command", "", "--a", "--b"); + MoreAsserts.assertContainsSublist(action.getArguments(), "-c", "dummy_command", "", "--a", "--b"); assertEquals("DummyMnemonic", action.getMnemonic()); assertEquals("dummy_message", action.getProgressMessage()); assertEquals(targetConfig.getDefaultShellEnvironment(), action.getEnvironment()); @@ -236,7 +237,7 @@ public class SkylarkRuleImplementationFunctionsTest extends SkylarkTestCase { ruleContext.getRuleContext().getAnalysisEnvironment().getRegisteredActions()); assertArtifactFilenames(action.getInputs(), "a.txt", "b.img", "t.exe"); assertArtifactFilenames(action.getOutputs(), "a.txt", "b.img"); - assertContainsSublist(action.getArguments(), "foo/t.exe", "--a", "--b"); + MoreAsserts.assertContainsSublist(action.getArguments(), "foo/t.exe", "--a", "--b"); } public void testCreateSpawnActionArgumentsBadExecutable() throws Exception { |