1. Sebastian Sdorra
  2. scm-manager

Commits

Sebastian Sdorra  committed 6d00b04

improve unit test for repository name validation

  • Participants
  • Parent commits e297401
  • Branches issue-142

Comments (0)

Files changed (1)

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

View file
  • Ignore whitespace
     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"));
   }