From ef202634c4aaa484cf9705976742df4a3ab82611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Fri, 13 Sep 2024 14:21:41 +0200 Subject: [PATCH] Adding comment and verify: --- .../MicBrokenSyncOriginDefinition.class.st | 6 ++++++ src/Microdown-BookTester/MicSyncTesterStrategy.class.st | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Microdown-BookTester/MicBrokenSyncOriginDefinition.class.st b/src/Microdown-BookTester/MicBrokenSyncOriginDefinition.class.st index d43e7a59..8cd02f59 100644 --- a/src/Microdown-BookTester/MicBrokenSyncOriginDefinition.class.st +++ b/src/Microdown-BookTester/MicBrokenSyncOriginDefinition.class.st @@ -1,3 +1,9 @@ +" +The origin in `sync=true&origin=Class>>#selector` should point to a method. A method either in the instance or class side. + +I represent a wrong or badly defined origin specification so I represent that the + user specified something else than C [class]>>#selector +" Class { #name : 'MicBrokenSyncOriginDefinition', #superclass : 'MicResult', diff --git a/src/Microdown-BookTester/MicSyncTesterStrategy.class.st b/src/Microdown-BookTester/MicSyncTesterStrategy.class.st index bfb30950..f7708d33 100644 --- a/src/Microdown-BookTester/MicSyncTesterStrategy.class.st +++ b/src/Microdown-BookTester/MicSyncTesterStrategy.class.st @@ -54,7 +54,7 @@ MicSyncTesterStrategy >> verify: aCodeBlock [ splits := originString splitOn: '>>'. ( splits size = 2 ) - ifFalse: [ self halt.self handleBrokenOrigin: originString of: aCodeBlock ] + ifFalse: [ self handleBrokenOrigin: originString of: aCodeBlock ] ifTrue: [ | class | @@ -65,14 +65,14 @@ MicSyncTesterStrategy >> verify: aCodeBlock [ isMeta := isMeta = 'class' ]. class := Smalltalk globals at: className first asSymbol - ifAbsent: [ self halt. ^ self handleBrokenOrigin: originString of: aCodeBlock ]. + ifAbsent: [ ^ self handleBrokenOrigin: originString of: aCodeBlock ]. isMeta ifTrue: [ class := class class ]. class compiledMethodAt: splits second trimBoth allButFirst asSymbol ifPresent: [ :m | method := m ] - ifAbsent: [ self halt. ^ self + ifAbsent: [ ^ self handleBrokenOrigin: originString of: aCodeBlock ].