diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java b/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java index b84af2fde6..9a39bbfda1 100644 --- a/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java +++ b/src/test/java/com/google/devtools/build/lib/cmdline/RepositoryNameTest.java @@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import com.google.devtools.build.lib.vfs.PathFragment; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -56,4 +57,14 @@ public class RepositoryNameTest { assertNotValid("@foo\0", "workspace names may contain only A-Z, a-z, 0-9, '-', '_' and '.'"); } + @Test + public void testRunfilesDir() throws Exception { + assertThat(RepositoryName.create("@foo").getRunfilesPath()) + .isEqualTo(new PathFragment("../foo")); + assertThat(RepositoryName.create("@").getRunfilesPath()) + .isEqualTo(PathFragment.EMPTY_FRAGMENT); + assertThat(RepositoryName.create("").getRunfilesPath()) + .isEqualTo(PathFragment.EMPTY_FRAGMENT); + } + } |