-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/MusicNotation-Tests.package/MNEditorTest.class/instance/testMethodCode.st
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,9 @@ | ||
tests | ||
testMethodCode | ||
| editor | | ||
|
||
editor := MNEditor new. | ||
editor updateContents: 'c4/8.'. | ||
self assert: (editor methodCodePrefix = ('DoIt', String cr)). | ||
self assert: (editor methodCode = ('DoIt', String cr, 'c4/8.')). | ||
self assert: ((editor statementMethodCode: 'Method not understood') = ('DoIt', String cr, 'Method not understood')). |
12 changes: 12 additions & 0 deletions
12
packages/MusicNotation-Tests.package/MNEditorTest.class/instance/testStatements.st
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,12 @@ | ||
tests | ||
testStatements | ||
| editor | | ||
|
||
editor := MNEditor new. | ||
editor updateContents: '"Comment"c1/4.2 timesRepeat: [ {c4 . d4 . e4 . f4} / 4 ].'. | ||
self assert: ((editor statementAt: 1) = '"Comment"'). | ||
self assert: ((editor statementAt: 2) = 'c1/4.'). | ||
self assert: ((editor statementAt: 3) = '2 timesRepeat: [ {c4 . d4 . e4 . f4} / 4 ].'). | ||
|
||
editor updateContents: '|var| var:=c1/4.2 timesRepeat: [var].'. | ||
self assert: ((editor localVariablesStatement: 'var:=c1/4.') = '| var |var :=c1/4.^ ((Dictionary new) at: ''var'' put: var; yourself)'). |
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