Skip to content

Commit

Permalink
test(cryptogram_string_extension): add test case for solmization
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 committed Jun 2, 2023
1 parent 0aab48b commit bb28392
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/model/cryptogram_scheme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ class CryptogramScheme {
RegExp('sol?', caseSensitive: false): Note.g,
RegExp('la', caseSensitive: false): Note.a,
RegExp('(t|s)i', caseSensitive: false): Note.b,
RegExp('a', caseSensitive: false): Note.a,
RegExp('d', caseSensitive: false): Note.c,
RegExp('r', caseSensitive: false): Note.d,
RegExp('m', caseSensitive: false): Note.e,
RegExp('f', caseSensitive: false): Note.f,
RegExp('a', caseSensitive: false): Note.f,
RegExp('e', caseSensitive: false): Note.d,
RegExp('i', caseSensitive: false): Note.e,
RegExp('u', caseSensitive: false): Note.c,
};

/// Arisen late in the 19th century, it was more akin to normal encipherment.
Expand Down
7 changes: 7 additions & 0 deletions test/model/cryptogram_string_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ void main() {
group('CryptogramStringExtension', () {
group('.toCryptogram()', () {
test('should return the musical cryptogram of this String', () {
final herculesDuxFerrarie = 'Hercules Dux Ferrarie'
.toCryptogram(CryptogramScheme.solmization());
expect(
herculesDuxFerrarie,
[Note.d, Note.c, Note.d, Note.c, Note.d, Note.f, Note.e, Note.d],
);

final arnoldSchonberg =
'A. SCHBEG'.toCryptogram(CryptogramScheme.german());
expect(
Expand Down

0 comments on commit bb28392

Please sign in to comment.