diff --git a/jubeatools/formats/jubeat_analyser/tests/memo/__init__.py b/jubeatools/formats/jubeat_analyser/tests/memo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jubeatools/formats/jubeat_analyser/tests/memo/example1.py b/jubeatools/formats/jubeat_analyser/tests/memo/example1.py new file mode 100644 index 0000000..3688a0f --- /dev/null +++ b/jubeatools/formats/jubeat_analyser/tests/memo/example1.py @@ -0,0 +1,69 @@ +from jubeatools.song import TapNote, LongNote, NotePosition +from fractions import Fraction + +notes = { + TapNote(time=Fraction(0, 1), position=NotePosition(x=0, y=0)), + TapNote(time=Fraction(0, 1), position=NotePosition(x=0, y=1)), + TapNote(time=Fraction(0, 1), position=NotePosition(x=0, y=3)), + LongNote( + time=Fraction(0, 1), + position=NotePosition(x=1, y=0), + duration=Fraction(1, 16), + tail_tip=NotePosition(x=2, y=0), + ), + TapNote(time=Fraction(0, 1), position=NotePosition(x=1, y=1)), + LongNote( + time=Fraction(0, 1), + position=NotePosition(x=1, y=2), + duration=Fraction(1, 3), + tail_tip=NotePosition(x=2, y=2), + ), + LongNote( + time=Fraction(1, 8), + position=NotePosition(x=0, y=3), + duration=Fraction(1, 4), + tail_tip=NotePosition(x=2, y=3), + ), + TapNote(time=Fraction(1, 4), position=NotePosition(x=0, y=0)), + TapNote(time=Fraction(5, 16), position=NotePosition(x=1, y=0)), + LongNote( + time=Fraction(1, 2), + position=NotePosition(x=0, y=0), + duration=Fraction(1, 16), + tail_tip=NotePosition(x=1, y=0), + ), + LongNote( + time=Fraction(5, 8), + position=NotePosition(x=0, y=3), + duration=Fraction(1, 4), + tail_tip=NotePosition(x=1, y=3), + ), + TapNote(time=Fraction(13, 16), position=NotePosition(x=0, y=0)), + LongNote( + time=Fraction(17, 16), + position=NotePosition(x=0, y=0), + duration=Fraction(1, 4), + tail_tip=NotePosition(x=1, y=0), + ), + LongNote( + time=Fraction(25, 16), + position=NotePosition(x=0, y=0), + duration=Fraction(1, 4), + tail_tip=NotePosition(x=2, y=0), + ), + TapNote(time=Fraction(33, 16), position=NotePosition(x=0, y=0)), + TapNote(time=Fraction(57, 8), position=NotePosition(x=1, y=1)), + TapNote(time=Fraction(59, 8), position=NotePosition(x=1, y=1)), + TapNote(time=Fraction(61, 8), position=NotePosition(x=1, y=1)), + TapNote(time=Fraction(63, 8), position=NotePosition(x=1, y=1)), + TapNote(time=Fraction(79, 8), position=NotePosition(x=1, y=1)), + TapNote(time=Fraction(187, 16), position=NotePosition(x=1, y=0)), + TapNote(time=Fraction(191, 16), position=NotePosition(x=1, y=0)), + LongNote( + time=Fraction(97, 8), + position=NotePosition(x=1, y=1), + duration=Fraction(1, 4), + tail_tip=NotePosition(x=2, y=1), + ), + TapNote(time=Fraction(195, 16), position=NotePosition(x=1, y=0)), +} diff --git a/jubeatools/formats/jubeat_analyser/tests/test_memo.py b/jubeatools/formats/jubeat_analyser/tests/memo/test_memo.py similarity index 75% rename from jubeatools/formats/jubeat_analyser/tests/test_memo.py rename to jubeatools/formats/jubeat_analyser/tests/memo/test_memo.py index f7e2e27..21a9d7b 100644 --- a/jubeatools/formats/jubeat_analyser/tests/test_memo.py +++ b/jubeatools/formats/jubeat_analyser/tests/memo/test_memo.py @@ -1,9 +1,9 @@ from decimal import Decimal from fractions import Fraction from pathlib import Path -from typing import List, Union +from typing import Set, Union -from hypothesis import given +from hypothesis import given, example from jubeatools.song import ( BeatsTime, @@ -18,13 +18,15 @@ from jubeatools.song import ( ) from jubeatools.testutils.strategies import NoteOption from jubeatools.testutils.strategies import notes as notes_strat +from jubeatools.formats.jubeat_analyser.memo.dump import _dump_memo_chart +from jubeatools.formats.jubeat_analyser.memo.load import MemoParser -from ..memo.dump import _dump_memo_chart -from ..memo.load import MemoParser +from . import example1 @given(notes_strat(NoteOption.LONGS)) -def test_many_notes(notes: List[Union[TapNote, LongNote]]) -> None: +@example(example1.notes) +def test_many_notes(notes: Set[Union[TapNote, LongNote]]) -> None: timing = Timing( events=[BPMEvent(BeatsTime(0), Decimal(120))], beat_zero_offset=SecondsTime(0) )