Fix test case
This commit is contained in:
parent
e69b0dab18
commit
c629fa7c0b
|
@ -100,15 +100,19 @@ public class ReleaseInfo {
|
||||||
// check file and folder for release group names
|
// check file and folder for release group names
|
||||||
String[] groups = releaseGroup.get();
|
String[] groups = releaseGroup.get();
|
||||||
|
|
||||||
// try case-sensitive match
|
for (boolean strict : new boolean[] { true, false }) {
|
||||||
String match = matchLast(getReleaseGroupPattern(true), groups, name);
|
String match = matchLast(getReleaseGroupPattern(strict), groups, name);
|
||||||
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
|
// group pattern does not match closing brackets in GROUP[INDEX] patterns
|
||||||
|
if (match.lastIndexOf(']') < match.lastIndexOf('[')) {
|
||||||
|
return match + ']';
|
||||||
|
}
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// try case-insensitive match
|
return null;
|
||||||
return matchLast(getReleaseGroupPattern(false), groups, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Pattern languageTag;
|
private Pattern languageTag;
|
||||||
|
|
|
@ -20,6 +20,8 @@ public class ReleaseInfoTest {
|
||||||
@Test
|
@Test
|
||||||
public void getReleaseGroup() throws Exception {
|
public void getReleaseGroup() throws Exception {
|
||||||
assertEquals("aXXo", info.getReleaseGroup("Jurassic.Park[1993]DvDrip-aXXo"));
|
assertEquals("aXXo", info.getReleaseGroup("Jurassic.Park[1993]DvDrip-aXXo"));
|
||||||
|
assertEquals("aXXo", info.getReleaseGroup("Jurassic.Park[1993]DvDrip-[aXXo]"));
|
||||||
|
assertEquals("aXXo[RARBG]", info.getReleaseGroup("Jurassic.Park[1993]DvDrip-aXXo[RARBG]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue