Fix infinite loop when no chapter number is parsed

This commit is contained in:
Robin Appelman
2016-02-16 20:37:57 +01:00
parent 1e81f75377
commit 57b64a412e
2 changed files with 16 additions and 6 deletions

View File

@@ -172,4 +172,11 @@ public class ChapterRecognitionTest {
ChapterRecognition.parseChapterNumber(c, randomManga);
assertThat(c.chapter_number).isEqualTo(027f);
}
@Test
public void testUnparsable() {
Chapter c = createChapter("Foo");
ChapterRecognition.parseChapterNumber(c, randomManga);
assertThat(c.chapter_number).isEqualTo(-1f);
}
}