Skip to content

Commit

Permalink
Fixes Slime test for empty statements (will work correctly after fix …
Browse files Browse the repository at this point in the history
…for issue pharo-project/pharo#15955 is merged into Pharo)
  • Loading branch information
jbrichau committed Jan 14, 2024
1 parent 4990652 commit 64ac15d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
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 64ac15d

Please sign in to comment.