feat(*): subsonic client with avfoundation playback and apple music ui
This commit is contained in:
commit
e5bb559d7f
93 files changed
+7517
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import Domain
|
||||
import Testing
|
||||
|
||||
struct LyricsTests {
|
||||
@Test func parsesSyncedLines() {
|
||||
let lyrics = Lyrics(lrc: "[00:11.39]Первая\n[00:13.61][01:20.18]Повтор\n[02:00.75]\n")
|
||||
#expect(lyrics?.isSynced == true)
|
||||
#expect(lyrics?.lines.map(\.text) == ["Первая", "Повтор", "Повтор", ""])
|
||||
#expect(lyrics?.lines[2].time == 80.18)
|
||||
#expect(lyrics?.index(at: 5) == nil)
|
||||
#expect(lyrics?.index(at: 12) == 0)
|
||||
#expect(lyrics?.index(at: 90) == 2)
|
||||
}
|
||||
|
||||
@Test func fallsBackToPlainText() {
|
||||
let lyrics = Lyrics(lrc: "Просто строка\nЕщё одна")
|
||||
#expect(lyrics?.isSynced == false)
|
||||
#expect(lyrics?.lines.count == 2)
|
||||
#expect(Lyrics(lrc: "") == nil)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user