Add test confirming the dangling meta char exception is not thrown anymore (fix #1025)

This commit is contained in:
Winston Li
2016-10-09 08:46:37 +01:00
parent d3eb737120
commit c23c11973a
32 changed files with 545 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ public class GitProjectRepoTest {
private File rootdir;
FSGitRepoStore repoStore;
GitProjectRepo repo;
GitProjectRepo badGitignore;
@Before
public void setup() throws IOException {
@@ -50,6 +51,8 @@ public class GitProjectRepoTest {
repoStore = new FSGitRepoStore(rootdir.getAbsolutePath());
repo = new GitProjectRepo("repo");
repo.useExistingRepository(repoStore);
badGitignore = new GitProjectRepo("badgitignore");
badGitignore.useExistingRepository(repoStore);
}
private GitDirectoryContents makeDirContents(
@@ -121,4 +124,21 @@ public class GitProjectRepoTest {
);
}
@Test
public void badGitignoreShouldNotThrow() throws IOException {
GitDirectoryContents contents = makeDirContents(
".gitignore",
"*.ignored\n",
"file1.ignored",
"",
"file1.txt",
"",
"file2.txt",
"",
"added.ignored",
""
);
badGitignore.commitAndGetMissing(contents);
}
}