Skip to content

Commit

Permalink
Merge branch 'release-candidate' into gs64_metaprogramming_binding
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Aug 7, 2023
2 parents 8241f5f + ea9229e commit 96f48ad
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 40 deletions.
6 changes: 5 additions & 1 deletion rowan/components/Deployment.ston
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RwSimpleProjectLoadComponentV2 {
'Buoy-Conditions',
'Buoy-Conditions-Extensions',
'Buoy-Dynamic-Binding',
'Buoy-Exception-Handling-Extensions',
'Buoy-Math-GS64-Extensions',
'Buoy-Metaprogramming',
'Buoy-Metaprogramming-Extensions',
Expand All @@ -29,13 +30,16 @@ RwSimpleProjectLoadComponentV2 {
},
'Buoy-Collections-GS64-Extensions' : {
'symbolDictName' : 'Globals'
},
},
'Buoy-Comparison-Extensions' : {
'symbolDictName' : 'Globals'
},
'Buoy-Conditions-Extensions' : {
'symbolDictName' : 'Globals'
},
'Buoy-Exception-Handling-Extensions' : {
'symbolDictName' : 'Globals'
},
'Buoy-Math-GS64-Extensions' : {
'symbolDictName' : 'Globals'
},
Expand Down
1 change: 1 addition & 0 deletions rowan/components/Tests.ston
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RwSimpleProjectLoadComponentV2 {
'Buoy-Comparison-Tests',
'Buoy-Conditions-Tests',
'Buoy-Dynamic-Binding-Tests',
'Buoy-Exception-Handling-Tests',
'Buoy-Metaprogramming-Tests',
'Buoy-SUnit-Tests'
],
Expand Down
6 changes: 3 additions & 3 deletions source/BaselineOfBuoy/BaselineOfBuoy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ BaselineOfBuoy >> baselineDynamicBinding: spec [
BaselineOfBuoy >> baselineExceptionHandling: spec [

spec
package: 'Buoy-Exception-Handling';
group: 'Deployment' with: 'Buoy-Exception-Handling';
package: 'Buoy-Exception-Handling-Tests' with: [ spec requires: 'Buoy-Exception-Handling' ];
package: 'Buoy-Exception-Handling-Extensions';
group: 'Deployment' with: 'Buoy-Exception-Handling-Extensions';
package: 'Buoy-Exception-Handling-Tests' with: [ spec requires: 'Buoy-Exception-Handling-Extensions' ];
group: 'Tests' with: 'Buoy-Exception-Handling-Tests'
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Extension { #name : #BlockClosure }

{ #category : #'*Buoy-Exception-Handling-Extensions' }
BlockClosure >> on: selector except: exclusionSelector do: action [

^ self
on: selector
do: [ :exception |
(exclusionSelector handles: exception)
ifTrue: [ exception pass ]
ifFalse: [ action value: exception ] ]
]
1 change: 1 addition & 0 deletions source/Buoy-Exception-Handling-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Buoy-Exception-Handling-Extensions' }
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,27 @@ ExceptionHandlingSystemTest >> handleZeroDivideAndReturnWithCaret [
{ #category : #'tests - exception sets' }
ExceptionHandlingSystemTest >> testCatchingSetsOfExceptions [

| result |

result := [ ZeroDivide signal + Warning signal ]
on: Warning , ZeroDivide
do: [ :ex | ex resume: 1 ].

self assert: result equals: 2
self assert: ([
Warning signal.
false ]
on: Warning , ZeroDivide
do: [ :ex | ex return: true ]).

self assert: ([
ZeroDivide signal.
false ]
on: Warning , ZeroDivide
do: [ :ex | ex return: true ])
]

{ #category : #'tests - exception sets' }
ExceptionHandlingSystemTest >> testCatchingSetsOfExceptionsWithHierarchy [

| result |

result := [ ZeroDivide signal + Warning signal ]
on: Notification , Error
do: [ :ex | ex resume: 1 ].

self assert: result equals: 2
self assert: ([
Warning signal.
false ]
on: Notification , Error
do: [ :ex | ex return: true ])
]

{ #category : #'tests - ensure' }
Expand Down Expand Up @@ -85,19 +87,13 @@ ExceptionHandlingSystemTest >> testEnsureSemanticsWhenNoException [
{ #category : #'tests - exception sets' }
ExceptionHandlingSystemTest >> testExceptionSetsConcatenation [

| result |

result := [ ZeroDivide signal + Warning signal ]
on: Warning , ZeroDivide , ( MessageNotUnderstood , Error )
do: [ :ex | ex resume: 1 ].

self assert: result equals: 2.

result := [ ZeroDivide signal + Warning signal ]
on: MessageNotUnderstood , Error , ( Warning , ZeroDivide )
do: [ :ex | ex resume: 1 ].
self assert: ([ ZeroDivide signal ]
on: Warning , ZeroDivide , (MessageNotUnderstood , Error)
do: [ :ex | ex return: true ]).

self assert: result equals: 2
self assert: ([ Object new perform: #asdf ]
on: MessageNotUnderstood , Error , (Warning , ZeroDivide)
do: [ :ex | ex return: true ])
]

{ #category : #'tests - exception sets' }
Expand Down
9 changes: 0 additions & 9 deletions source/Buoy-Exception-Handling/BlockClosure.extension.st

This file was deleted.

1 change: 0 additions & 1 deletion source/Buoy-Exception-Handling/package.st

This file was deleted.

0 comments on commit 96f48ad

Please sign in to comment.