Skip to content

Commit

Permalink
Linting. ref. #123
Browse files Browse the repository at this point in the history
  • Loading branch information
rdunker committed Jul 3, 2021
1 parent ee852a7 commit ad088e6
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testDoItEnvironment
| editor old |

editor := MNEditor new.
self deny: editor environment isNil.
self deny: editor doItEnvironment isNil.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testLocalVariableStatement
| editor |
| editor |

editor := MNEditor new.
editor updateContents: '| var | var := 1. var := var + 1.'.
self assert: (editor localVariablesStatement: 'var := var + 1.') = '| var |var := (self localVariables at: ''var'') + 1.^ ((Dictionary new) at: ''var'' put: var; yourself)'.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
tests
testMenuItems
| editor |

editor := MNEditor new.
editor addModelItemsToWindowMenu: MenuMorph new.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testOpenEditor
| editor |

editor := MNEditor new.
self ensureAbandonOf: editor openEditor
do: [ :morph |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testOpenPreview
| editor |

editor := MNEditor new.
self ensureAbandonOf: editor openPreview
do: [ :morph |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testSmuflFontDisplay
| drawer |

drawer := MNSmuflDrawer new
canvas: self hiddenCanvas asBalloonCanvas;
color: Color red;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testStatementMapping
| editor |

editor := MNEditor new.
editor updateContents: 'g4/8.g4/4.'.
editor evaluateContentList.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests
testTextContents
| editor |

editor := MNEditor new.
editor textContents: '123'.
self assert: '123' equals: editor contents.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"instance" : {
"ensureAbandonOf:do:" : "mgjm 7/5/2019 20:47",
"hiddenCanvas" : "mgjm 7/5/2019 20:06",
"testDoItEnvironment" : "fb 7/25/2019 19:32",
"testLocalVariableStatement" : "RAD 6/29/2021 12:42",
"testMenuItems" : "mgjm 7/5/2019 20:23",
"testOpenEditor" : "RAD 5/27/2021 14:20",
"testDoItEnvironment" : "RAD 7/3/2021 12:21",
"testLocalVariableStatement" : "RAD 7/3/2021 12:21",
"testMenuItems" : "RAD 7/3/2021 12:21",
"testOpenEditor" : "RAD 7/3/2021 12:21",
"testOpenEditorClass" : "mgjm 7/5/2019 20:44",
"testOpenPreview" : "mgjm 7/5/2019 20:47",
"testSmuflFontDisplay" : "mgjm 7/5/2019 20:43",
"testStatementMapping" : "RAD 6/11/2021 19:33",
"testTextContents" : "mgjm 7/5/2019 20:30" } }
"testOpenPreview" : "RAD 7/3/2021 12:21",
"testSmuflFontDisplay" : "RAD 7/3/2021 12:21",
"testStatementMapping" : "RAD 7/3/2021 12:21",
"testTextContents" : "RAD 7/3/2021 12:21" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am a class to test the ledger lines.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
as yet unclassified
tests
createNoteWithDuration: aFraction step: aSymbol octave: aNumber
| pitch note noteMorph |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
as yet unclassified
tests
testFirstLedgerLine
"Ignore while linting"
| noteC4 noteC5 noteC6 offset |

offset := 2.
noteC4 := self createNoteWithDuration: (1/8) step: $c octave: 4.
noteC5 := self createNoteWithDuration: (1/8) step: $c octave: 5.
noteC6 := self createNoteWithDuration: (1/8) step: $c octave: 6.

noteC4 noteLayout lines at: 1 put: ((noteC4 noteLayout lines at: 1) - offset).
noteC5 noteLayout lines at: 1 put: ((noteC5 noteLayout lines at: 1) - offset).
noteC6 noteLayout lines at: 1 put: ((noteC6 noteLayout lines at: 1) - offset).
noteC4 noteLayout lines at: 1 put: ((noteC4 noteLayout lines first) - offset).
noteC5 noteLayout lines at: 1 put: ((noteC5 noteLayout lines first) - offset).
noteC6 noteLayout lines at: 1 put: ((noteC6 noteLayout lines first) - offset).

self assert: 3 equals: (noteC4 noteLayout firstLedgerLine).
self assert: 0 equals: (noteC5 noteLayout firstLedgerLine).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
as yet unclassified
tests
testLastLedgerLine
"Ignore while linting"
| noteC4 noteC5 noteC6 offset |

offset := 2.
noteC4 := self createNoteWithDuration: (1/8) step: $c octave: 4.
noteC5 := self createNoteWithDuration: (1/8) step: $c octave: 5.
noteC6 := self createNoteWithDuration: (1/8) step: $c octave: 6.

noteC4 noteLayout lines at: 1 put: ((noteC4 noteLayout lines at: 1) - offset).
noteC5 noteLayout lines at: 1 put: ((noteC5 noteLayout lines at: 1) - offset).
noteC6 noteLayout lines at: 1 put: ((noteC6 noteLayout lines at: 1) - offset).
noteC4 noteLayout lines at: 1 put: ((noteC4 noteLayout lines first) - offset).
noteC5 noteLayout lines at: 1 put: ((noteC5 noteLayout lines first) - offset).
noteC6 noteLayout lines at: 1 put: ((noteC6 noteLayout lines first) - offset).

self assert: 3 equals: (noteC4 noteLayout lastLedgerLine).
self assert: -0.5 equals: (noteC5 noteLayout lastLedgerLine).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
as yet unclassified
tests
testNeedsLedgerLine
"Ignore while linting"
| noteC4 noteC5 noteC6 offset |

offset := 2.
noteC4 := self createNoteWithDuration: (1/8) step: $c octave: 4.
noteC5 := self createNoteWithDuration: (1/8) step: $c octave: 5.
noteC6 := self createNoteWithDuration: (1/8) step: $c octave: 6.

noteC4 noteLayout lines at: 1 put: ((noteC4 noteLayout lines at: 1) - offset).
noteC5 noteLayout lines at: 1 put: ((noteC5 noteLayout lines at: 1) - offset).
noteC6 noteLayout lines at: 1 put: ((noteC6 noteLayout lines at: 1) - offset).
noteC4 noteLayout lines at: 1 put: ((noteC4 noteLayout lines first) - offset).
noteC5 noteLayout lines at: 1 put: ((noteC5 noteLayout lines first) - offset).
noteC6 noteLayout lines at: 1 put: ((noteC6 noteLayout lines first) - offset).

self assert: true equals: (noteC4 noteLayout needsLedgerLines).
self assert: false equals: (noteC5 noteLayout needsLedgerLines).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
},
"instance" : {
"createNoteWithDuration:step:octave:" : "LH 6/30/2021 21:08",
"testFirstLedgerLine" : "LH 6/30/2021 21:52",
"testLastLedgerLine" : "LH 6/30/2021 21:52",
"testNeedsLedgerLine" : "LH 6/30/2021 21:58" } }
"testFirstLedgerLine" : "RAD 7/3/2021 12:28",
"testLastLedgerLine" : "RAD 7/3/2021 12:29",
"testNeedsLedgerLine" : "RAD 7/3/2021 12:29" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "RAD 7/3/2021 12:24",
"instvars" : [
],
"name" : "MNLedgerLinesTests",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am a class to test the Music-Notation-Player package.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
as yet unclassified
tests
testAddSounds
"ignore while liniting"
"Ignore while linting"
| generator note pitch testWithNote testWithPitch |

generator := MNSoundGenerator new.
pitch := MNPitch new
octave: 4;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
as yet unclassified
tests
testVisitProject
"ignore while liniting"
"Ignore while linting"
| generator project part1 part2 measure1 measure2 note1 note2 pitch1 pitch2 |
generator := MNSoundGenerator new.
project := MNProject new.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"class" : {
},
"instance" : {
"testAddSounds" : "LH 7/1/2021 10:34",
"testVisitProject" : "LH 7/1/2021 11:53" } }
"testAddSounds" : "RAD 7/3/2021 12:22",
"testVisitProject" : "RAD 7/3/2021 12:22" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "RAD 7/3/2021 12:25",
"instvars" : [
],
"name" : "MNPlayerTest",
Expand Down

0 comments on commit ad088e6

Please sign in to comment.