Commits

Sebastian Sdorra committed 6d00b04

improve unit test for repository name validation

Comments (0)

Files changed (1)

scm-core/src/test/java/sonia/scm/util/ValidationUtilTest.java

     assertTrue(ValidationUtil.isRepositoryNameValid("scm"));
     assertTrue(ValidationUtil.isRepositoryNameValid("scm/main"));
     assertTrue(ValidationUtil.isRepositoryNameValid("scm/plugins/git-plugin"));
+    assertTrue(ValidationUtil.isRepositoryNameValid("s"));
+    assertTrue(ValidationUtil.isRepositoryNameValid("sc"));
 
     // issue 142
     assertFalse(ValidationUtil.isRepositoryNameValid("."));
+    assertFalse(ValidationUtil.isRepositoryNameValid("/"));
     assertFalse(ValidationUtil.isRepositoryNameValid(".scm/plugins"));
-    assertTrue(ValidationUtil.isRepositoryNameValid("scm/plugins/."));
+    assertFalse(ValidationUtil.isRepositoryNameValid("scm/plugins/."));
     assertFalse(ValidationUtil.isRepositoryNameValid("scm/../plugins"));
   }