Skip to content

Commit

Permalink
Add tests for new cases
Browse files Browse the repository at this point in the history
  • Loading branch information
YohayAiTe committed Dec 29, 2024
1 parent c4dd7d4 commit bc6b4d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/formats/test_id3.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,13 +799,21 @@ def test_syncedlyrics_converting_to_sylt(self):
"[00:00.000]Test lyrics with\n[01:00.000]only line time stamps",
"<00:00.000>Test lyrics with<01:00.000>only syllable time stamps",
"[00:00.000]<00:00.000>Test extra\n<00:00.750>[00:00.750]<00:00.750>timestamp<00:01.500>",
"[00:01.00]<00:01.00>Test lyrics with two\n[00:01.75]<00:01.75>digit ms",
"[01:01.0]<01:01.000>Test lyrics with different\n[01:01.8]<01:01.7506>digit ms",
"[2:1.0]<2:1.0>Test lyrics with single digits\n[2:2]<2:2>or no ms",
"[300:1.000]<300:1.000>Test lyrics with long minutes",
"Test invalid[00:00.000]input\nTest invalid[00:01.000]input",
"Test lyrics with no timestamps")
correct_sylt = (
[("Test", 0), ("normal\n", 500), ("behaviour", 1000)],
[("Test lyrics with\n", 0), ("only line time stamps", 60 * 1000)],
[("Test lyrics with", 0), ("only syllable time stamps", 60 * 1000)],
[("Test extra\n", 0), ("timestamp", 750), ("", 1500)],
[("Test lyrics with two\n", 1000), ("digit ms", 1750)],
[("Test lyrics with different\n", 61000), ("digit ms", 61750)],
[("Test lyrics with single digits\n", 121000), ("or no ms", 122000)],
[("Test lyrics with long minutes", (300*60+1)*1000)],
[("input\nTest invalid", 0), ("input", 1000)],
[])
for lrc, correct_sylt in zip(lrc, correct_sylt):
Expand Down

0 comments on commit bc6b4d6

Please sign in to comment.