From 64ac15d95c5d77326deb5c3b4759d6b3c4189f23 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Sun, 14 Jan 2024 14:04:09 +0100 Subject: [PATCH 1/2] Fixes Slime test for empty statements (will work correctly after fix for issue https://github.com/pharo-project/pharo/issues/15955 is merged into Pharo) --- .../GRReSlimeTest.class/instance/rules.st | 2 ++ .../instance/testEmptyStatements.st | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/rules.st b/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/rules.st index a7984364..13c0034b 100644 --- a/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/rules.st +++ b/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/rules.st @@ -5,4 +5,6 @@ rules addAll: GRSlimeBlockLintRule allSubclasses; addAll: GRSlimeParseTreeLintRule allSubclasses; addAll: GRSlimeTransformationRule allSubclasses; + add: ReMultiplePeriodsTerminatingStatementRule; + add: ReMethodSignaturePeriodRule; yourself) reject: #isAbstract \ No newline at end of file diff --git a/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/testEmptyStatements.st b/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/testEmptyStatements.st index 352c6fdc..7e3c3a62 100644 --- a/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/testEmptyStatements.st +++ b/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/testEmptyStatements.st @@ -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." - | 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) \ No newline at end of file + matches: { class>>#emptyStatement2 . class>>#emptyStatement3 . class>>#emptyStatement4 } + ignoring: { ReMethodSignaturePeriodRule }. + self + assertRule: ReMethodSignaturePeriodRule + matches: { class>>#emptyStatement1 } + ignoring: { ReMultiplePeriodsTerminatingStatementRule }. \ No newline at end of file From b073206c228ea0fd8aa7e62b9be07470ee19a961 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Sat, 27 Jan 2024 09:21:03 +0100 Subject: [PATCH 2/2] Mark testEmptyStatements as fixed in Pharo 12 but breaking in earlier versions --- .../GRReSlimeTest.class/instance/expectedFailures.st | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/expectedFailures.st diff --git a/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/expectedFailures.st b/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/expectedFailures.st new file mode 100644 index 00000000..8c178caf --- /dev/null +++ b/repository/Grease-Tests-Pharo-Slime.package/GRReSlimeTest.class/instance/expectedFailures.st @@ -0,0 +1,6 @@ +running +expectedFailures + + SystemVersion current major >= 12 ifTrue:[ ^ #() ]. + + ^ #(#testEmptyStatements) \ No newline at end of file