From 7d64fee22c0691fb1f83048b794533d277df8433 Mon Sep 17 00:00:00 2001 From: Carlos Escobedo Date: Thu, 25 Jan 2018 06:44:48 -0500 Subject: [PATCH] removed empty line added test case --- .../eu/kanade/tachiyomi/util/ChapterRecognition.kt | 1 - .../tachiyomi/data/database/ChapterRecognitionTest.kt | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt index 45b2b67db8..9ee6774a76 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt @@ -37,7 +37,6 @@ object ChapterRecognition { */ private val unwantedWhiteSpace = Regex("""(\s)(extra|special|omake)""") - fun parseChapterNumber(chapter: SChapter, manga: SManga) { // If chapter number is known return. if (chapter.chapter_number == -2f || chapter.chapter_number > -1f) diff --git a/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt b/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt index e5e4516bb1..ee8c1f33a4 100644 --- a/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt +++ b/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt @@ -58,6 +58,17 @@ class ChapterRecognitionTest { assertThat(chapter.chapter_number).isEqualTo(4f) } + /** + * Ch. xx base case but space after period + */ + @Test fun ChCaseBase2() { + createManga("Mokushiroku Alice") + + createChapter("Mokushiroku Alice Vol. 1 Ch. 4: Misrepresentation") + ChapterRecognition.parseChapterNumber(chapter, manga) + assertThat(chapter.chapter_number).isEqualTo(4f) + } + /** * Ch.xx.x base case */