From cad6952c4df7eaed44d1c138f5ed190222d86773 Mon Sep 17 00:00:00 2001 From: Hogoww Date: Wed, 3 Apr 2019 11:09:28 +0200 Subject: [PATCH] [test] added a regression test for RBProgramNode >> #propertyAt:ifPresent:ifAbsent:. --- src/AST-Tests-Core/RBProgramNodeTest.class.st | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/AST-Tests-Core/RBProgramNodeTest.class.st b/src/AST-Tests-Core/RBProgramNodeTest.class.st index 22875d4d492..00ffcab8f29 100644 --- a/src/AST-Tests-Core/RBProgramNodeTest.class.st +++ b/src/AST-Tests-Core/RBProgramNodeTest.class.st @@ -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.