diff options
author | Florian Zschocke <florian.zschocke@devolo.de> | 2019-06-10 21:32:02 +0200 |
---|---|---|
committer | Florian Zschocke <florian.zschocke@devolo.de> | 2019-06-10 22:14:13 +0200 |
commit | 889c5cc75ef8a5b9313cf9300e35b5d68925f0bf (patch) | |
tree | 2bb2df9d732cecb506e306ecd7ae5f6eae0a5c99 /src/test/java | |
parent | a92a8fb1a1ea61783a6a9563aa9f6c0967c76089 (diff) | |
download | gitblit-889c5cc75ef8a5b9313cf9300e35b5d68925f0bf.tar.gz gitblit-889c5cc75ef8a5b9313cf9300e35b5d68925f0bf.zip |
Create unit tests for special characters in path names
Create a regression test for issue #999.
Add directories with '[]' ans '()' in the name to the
hello-world repository, so that they can be used in unit
tests for repository paths with special characters.
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/gitblit/tests/JGitUtilsTest.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/java/com/gitblit/tests/JGitUtilsTest.java b/src/test/java/com/gitblit/tests/JGitUtilsTest.java index 5f083555..a493884a 100644 --- a/src/test/java/com/gitblit/tests/JGitUtilsTest.java +++ b/src/test/java/com/gitblit/tests/JGitUtilsTest.java @@ -596,10 +596,22 @@ public class JGitUtilsTest extends GitblitUnitTest { @Test
public void testFilesInPath2() throws Exception {
assertEquals(0, JGitUtils.getFilesInPath2(null, null, null).size());
+
Repository repository = GitBlitSuite.getHelloworldRepository();
+
List<PathModel> files = JGitUtils.getFilesInPath2(repository, null, null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.top, 15), files.size());
+
+ files = JGitUtils.getFilesInPath2(repository, "C", null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.C.top, 1), files.size());
+
+ files = JGitUtils.getFilesInPath2(repository, "[C++]", null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.Cpp, 1), files.size());
+
+ files = JGitUtils.getFilesInPath2(repository, "C/C (K&R)", null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.C.KnR, 1), files.size());
+
repository.close();
- assertTrue(files.size() > 10);
}
@Test
|