-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Couple days of tinkering on Exercise
- Loading branch information
1 parent
eea8fc7
commit 5a9b9ec
Showing
10 changed files
with
351 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {fillWithRests, splitIntoMeasures} from "@/lib/vexMusic"; | ||
|
||
describe('vex music', () => { | ||
it('should place a list of notes into evenly divided measures', () => { | ||
const input = 'C2/q, D2, E2, F2, G2, A2, B2, C3, D3' | ||
const measures = splitIntoMeasures(input) | ||
|
||
// expect(measures.length).toBe(3) | ||
expect(measures[0]).toBe('C2/q, D2, E2, F2') | ||
expect(measures[1]).toBe('G2, A2, B2, C3') | ||
expect(measures[2]).toBe('D3, C4/h/r, C4/q/r') | ||
}) | ||
|
||
test.each([ | ||
["", "/w/r"], | ||
])( | ||
`%s measure should be filled with an %s rest`, | ||
(input: string, expectedRests: string) => expect(fillWithRests(input).includes('')).toBeTruthy() | ||
) | ||
}) |
Oops, something went wrong.