Skip to content

Commit c53e80a

Browse files
author
Johan Brichau
authored
Merge pull request #168 from SeasideSt/fix-testEmptyStatements
Fixes Slime test for empty statements (will work correctly after fix …
2 parents 9aac9aa + d8f5204 commit c53e80a

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
running
2+
expectedFailures
3+
4+
SystemVersion current major >= 12 ifTrue:[ ^ #() ].
5+
6+
^ #(#testEmptyStatements)

repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/rules.st

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ rules
55
addAll: GRSlimeBlockLintRule allSubclasses;
66
addAll: GRSlimeParseTreeLintRule allSubclasses;
77
addAll: GRSlimeTransformationRule allSubclasses;
8+
add: ReMultiplePeriodsTerminatingStatementRule;
9+
add: ReMethodSignaturePeriodRule;
810
yourself) reject: #isAbstract
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
tests-block
22
testEmptyStatements
33
"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."
4-
<expectedFailure>
54

65
| class |
76
class := self defineSubClassOf: #GRObject.
8-
self compile: 'emptyStatement1. self and' in: class.
9-
self compile: 'emptyStatement2 self and..' in: class.
10-
self compile: 'emptyStatement3 self and."foo".' in: class.
11-
self compile: 'emptyStatement4 self and."foo".self and' in: class.
7+
self compile: 'emptyStatement1.', (String with: Character cr), ' self and' in: class.
8+
self compile: 'emptyStatement2', (String with: Character cr), ' self and..' in: class.
9+
self compile: 'emptyStatement3', (String with: Character cr), ' self and."foo".' in: class.
10+
self compile: 'emptyStatement4', (String with: Character cr), ' self and."foo".self and' in: class.
1211
self
1312
assertRule: ReMultiplePeriodsTerminatingStatementRule
14-
matches: { class>>#emptyStatement1 . class>>#emptyStatement2 . class>>#emptyStatement3 . class>>#emptyStatement4 }
15-
ignoring: (Array with: ReUnnecessaryLastPeriodRule)
13+
matches: { class>>#emptyStatement2 . class>>#emptyStatement3 . class>>#emptyStatement4 }
14+
ignoring: { ReMethodSignaturePeriodRule }.
15+
self
16+
assertRule: ReMethodSignaturePeriodRule
17+
matches: { class>>#emptyStatement1 }
18+
ignoring: { ReMultiplePeriodsTerminatingStatementRule }.

0 commit comments

Comments
 (0)