@Test
public void testDirectoryBasedCtorArgumentValidation() throws Exception {

  try {
    Runfiles.createDirectoryBasedForTesting(null);
    fail();
  } catch (IllegalArgumentException e) {
    // expected
  }
  try {
    Runfiles.createDirectoryBasedForTesting("");
    fail();
  } catch (IllegalArgumentException e) {
    // expected
  }
  try {
    Runfiles.createDirectoryBasedForTesting("non-existent directory is bad");
    fail();
  } catch (IllegalArgumentException e) {
    // expected
  }
  Runfiles.createDirectoryBasedForTesting(System.getenv("TEST_TMPDIR"));
}