Skip to content

Commit

Permalink
made junit names unique using invisible character
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejmikosik committed Mar 14, 2015
1 parent 10bc851 commit 8e980f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main/java/org/quackery/Junit.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ private static synchronized TestCase makeNameUnique(TestCase test) {
String name = test.getName();
String newName = name;
if (names.containsKey(name) && !test.equals(names.get(name).get())) {
for (int i = 1;; i++) {
newName = name + " #" + i;
while (true) {
newName = newName + "\u200B";
if (!names.containsKey(newName)) {
break;
}
}

}
names.put(newName, new WeakReference<TestCase>(test));
test.setName(newName);
Expand Down

0 comments on commit 8e980f1

Please sign in to comment.