Skip to content

Commit

Permalink
test: Interval.fromSemitones()
Browse files Browse the repository at this point in the history
  • Loading branch information
plammens committed Apr 2, 2024
1 parent 99ceab6 commit c992c05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/src/interval/interval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ void main() {
});
});

group('fromSemitones()', () {
test('creates a new Interval from semitones', () {
expect(Interval.fromSemitones(0), Interval.P1);
expect(Interval.fromSemitones(2), Interval.M2);
expect(Interval.fromSemitones(-2), -Interval.M2);
expect(Interval.fromSemitones(3), Interval.m3);
expect(Interval.fromSemitones(-3), -Interval.m3);
expect(Interval.fromSemitones(5), Interval.P4);
expect(Interval.fromSemitones(20), Interval.m13);
expect(Interval.fromSemitones(-20), -Interval.m13);
});
});

group('.parse()', () {
test('throws a FormatException when source is invalid', () {
expect(() => Interval.parse('x'), throwsFormatException);
Expand Down

0 comments on commit c992c05

Please sign in to comment.