Skip to content

Commit

Permalink
Merge pull request #168 from SeasideSt/fix-testEmptyStatements
Browse files Browse the repository at this point in the history
Fixes Slime test for empty statements (will work correctly after fix …
  • Loading branch information
jbrichau authored Jan 27, 2024
2 parents 9aac9aa + d8f5204 commit c53e80a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
running
expectedFailures

SystemVersion current major >= 12 ifTrue:[ ^ #() ].

^ #(#testEmptyStatements)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ rules
addAll: GRSlimeBlockLintRule allSubclasses;
addAll: GRSlimeParseTreeLintRule allSubclasses;
addAll: GRSlimeTransformationRule allSubclasses;
add: ReMultiplePeriodsTerminatingStatementRule;
add: ReMethodSignaturePeriodRule;
yourself) reject: #isAbstract
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
tests-block
testEmptyStatements
"We added this test to make sure that this Pharo-supplied rule works because we previously had this one in Grease and it is important."
<expectedFailure>

| class |
class := self defineSubClassOf: #GRObject.
self compile: 'emptyStatement1. self and' in: class.
self compile: 'emptyStatement2 self and..' in: class.
self compile: 'emptyStatement3 self and."foo".' in: class.
self compile: 'emptyStatement4 self and."foo".self and' in: class.
self compile: 'emptyStatement1.', (String with: Character cr), ' self and' in: class.
self compile: 'emptyStatement2', (String with: Character cr), ' self and..' in: class.
self compile: 'emptyStatement3', (String with: Character cr), ' self and."foo".' in: class.
self compile: 'emptyStatement4', (String with: Character cr), ' self and."foo".self and' in: class.
self
assertRule: ReMultiplePeriodsTerminatingStatementRule
matches: { class>>#emptyStatement1 . class>>#emptyStatement2 . class>>#emptyStatement3 . class>>#emptyStatement4 }
ignoring: (Array with: ReUnnecessaryLastPeriodRule)
matches: { class>>#emptyStatement2 . class>>#emptyStatement3 . class>>#emptyStatement4 }
ignoring: { ReMethodSignaturePeriodRule }.
self
assertRule: ReMethodSignaturePeriodRule
matches: { class>>#emptyStatement1 }
ignoring: { ReMultiplePeriodsTerminatingStatementRule }.

0 comments on commit c53e80a

Please sign in to comment.