-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
5a8ca7e
commit d0e41b2
Showing
4 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package voice.data | ||
|
||
import io.kotest.matchers.collections.shouldContainInOrder | ||
import org.junit.Test | ||
import java.time.Instant | ||
|
||
class ChapterTest { | ||
|
||
@Test | ||
fun `chapter parsing does best effort on broken marks`() { | ||
val positions = Chapter( | ||
duration = 20L, | ||
fileLastModified = Instant.now(), | ||
id = ChapterId(""), | ||
markData = listOf(11, 5, 5, 10).mapIndexed { index, i -> | ||
MarkData( | ||
startMs = i.toLong(), | ||
name = "Mark $index", | ||
) | ||
}, | ||
name = "Chapter", | ||
).chapterMarks.map { MarkPosition(it.startMs, it.endMs) } | ||
|
||
positions.shouldContainInOrder( | ||
MarkPosition(0L, 9L), | ||
MarkPosition(10L, 19L), | ||
) | ||
} | ||
|
||
data class MarkPosition(val start: Long, val end: Long) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters