Skip to content

Commit

Permalink
Test editor. ref. #123
Browse files Browse the repository at this point in the history
  • Loading branch information
rdunker committed Jul 11, 2021
1 parent e90d8ff commit 7a099f2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
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')).
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)').
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"testDoItEnvironment" : "RAD 7/3/2021 12:21",
"testLocalVariableStatement" : "RAD 7/3/2021 12:21",
"testMenuItems" : "RAD 7/3/2021 12:21",
"testMethodCode" : "RAD 7/11/2021 15:06",
"testOpenEditor" : "RAD 7/3/2021 12:21",
"testOpenEditorClass" : "mgjm 7/5/2019 20:44",
"testOpenPreview" : "RAD 7/3/2021 12:21",
"testSmuflFontDisplay" : "RAD 7/3/2021 12:21",
"testStatementMapping" : "RAD 7/3/2021 12:21",
"testStatements" : "RAD 7/11/2021 15:07",
"testTextContents" : "RAD 7/3/2021 12:21" } }

0 comments on commit 7a099f2

Please sign in to comment.