Skip to content

Commit

Permalink
[test] added a regression test for RBProgramNode >> #propertyAt:ifPre…
Browse files Browse the repository at this point in the history
…sent:ifAbsent:.
  • Loading branch information
hogoww committed Apr 3, 2019
1 parent be91ba0 commit cad6952
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/AST-Tests-Core/RBProgramNodeTest.class.st
Expand Up @@ -207,6 +207,14 @@ RBProgramNodeTest >> testPropertyAtIfAbsentPut [
self assert: (self node propertyAt: #foo ifAbsentPut: [ false ])
]

{ #category : #'testing-properties' }
RBProgramNodeTest >> testPropertyAtIfPresentIfAbsent [
self assert: (self node propertyAt: #foo ifPresent:[ false ] ifAbsent: [ true ]) equals: true.
self node propertyAt: #foo put: true.
self assert: (self node propertyAt: #foo ifPresent:[ true ] ifAbsent: [ false ]).
self assert: (self node propertyAt: #toto ifPresent:[ false ] ifAbsent: [ true ])
]

{ #category : #'testing-properties' }
RBProgramNodeTest >> testRemoveProperty [
self should: [ self node removeProperty: #foo ] raise: Error.
Expand Down

0 comments on commit cad6952

Please sign in to comment.