diff options
author | Googler <noreply@google.com> | 2017-05-12 21:52:38 +0200 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-05-15 19:50:58 +0200 |
commit | 645981c6ce0480b6c75002edf465d092ca5b25cf (patch) | |
tree | 8f3fb03f0a718e2d45dbde5ebd378cc03d9fd701 /src/test/java | |
parent | 22228d1dc35d1cc1831203e551b5487053137ae7 (diff) |
Do not expand nested sets in resource merging action construction.
PiperOrigin-RevId: 155900259
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/actions/CustomCommandLineTest.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/CustomCommandLineTest.java b/src/test/java/com/google/devtools/build/lib/actions/CustomCommandLineTest.java index c0a808e921..eff6c637c1 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/CustomCommandLineTest.java +++ b/src/test/java/com/google/devtools/build/lib/actions/CustomCommandLineTest.java @@ -17,6 +17,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.actions.Artifact.ArtifactExpander; import com.google.devtools.build.lib.actions.Artifact.SpecialArtifact; @@ -31,14 +32,13 @@ import com.google.devtools.build.lib.cmdline.LabelSyntaxException; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.testutil.Scratch; import com.google.devtools.build.lib.vfs.PathFragment; - +import java.util.Collection; +import javax.annotation.Nullable; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Collection; - /** * Tests for CustomCommandLine. */ @@ -85,6 +85,25 @@ public class CustomCommandLineTest { } @Test + public void testJoinValues() { + CustomCommandLine cl = + CustomCommandLine.builder() + .addJoinValues( + "--path", + ":", + ImmutableList.of("foo", "bar", "baz"), + new Function<String, String>() { + @Nullable + @Override + public String apply(@Nullable String s) { + return s.toUpperCase(); + } + }) + .build(); + assertEquals(ImmutableList.of("--path", "FOO:BAR:BAZ"), cl.arguments()); + } + + @Test public void testArtifactExecPathArgs() { CustomCommandLine cl = CustomCommandLine.builder().addExecPath("--path", artifact1).build(); assertEquals(ImmutableList.of("--path", "dir/file1.txt"), cl.arguments()); |