Skip to content

Commit

Permalink
Updates for Pharo 12
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed May 8, 2024
1 parent eaeed0b commit a0ad191
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions repository/OpenPonk-PetriNets/OPPetriNetSimulatorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ OPPetriNetSimulatorTest >> testDefaultStepping [
simulator setDefaultStepping.

items := simulator itemsForAction.
self assert: items size = 1.
self assert: items size equals: 1.
item := items first.
self assert: item isSimulable.
self assert: item isSteppable.
self assert: (item isKindOf: OPPetriNetTransitionSimulator).

stepped := OrderedCollection new.
didAction := OrderedCollection new.
simulator simulableElementsDo: [ :each | each when: OPSimulatorStepped do: [ :event | stepped add: event ] ].
simulator simulableElementsDo: [ :each | each when: OPSimulatorDidAction do: [ :event | didAction add: event ] ].
simulator simulableElementsDo: [ :each | each when: OPSimulatorStepped do: [ :event | stepped add: event ] for: self ].
simulator simulableElementsDo: [ :each | each when: OPSimulatorDidAction do: [ :event | didAction add: event ] for: self ].
simulator step.
self assert: stepped size = 1.
self assert: didAction size = 2
self assert: stepped size equals: 1.
self assert: didAction size equals: 2
]

{ #category : 'tests' }
Expand All @@ -94,16 +94,16 @@ OPPetriNetSimulatorTest >> testSteppingAll [
simulator setSteppingAll.

items := simulator itemsForAction.
self assert: items size = 2.
self assert: items size equals: 2.
self assert: (items allSatisfy: [ :item | item isSimulable ]).
self assert: (items allSatisfy: [ :item | item isSteppable ]).
self assert: (items allSatisfy: [ :item | item isKindOf: OPPetriNetTransitionSimulator ]).

stepped := OrderedCollection new.
didAction := OrderedCollection new.
items do: [ :item | item when: OPSimulatorStepped do: [ :event | stepped add: event ] ].
items do: [ :item | item when: OPSimulatorDidAction do: [ :event | didAction add: event ] ].
items do: [ :item | item when: OPSimulatorStepped do: [ :event | stepped add: event ] for: self ].
items do: [ :item | item when: OPSimulatorDidAction do: [ :event | didAction add: event ] for: self ].
simulator step.
self assert: stepped size = 2.
self assert: didAction size = 4
self assert: stepped size equals: 2.
self assert: didAction size equals: 4
]

0 comments on commit a0ad191

Please sign in to comment.