'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 19 April 2007 at 10:50:35 am'!
TestCase subclass: #IfNotNilTests
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'VB-IfNotNil-Tests'!

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:43'!
testIfNilIfNotNil0Arg

	self assert: (5 ifNil: [#foo] ifNotNil: [#bar]) = #bar.
	self assert: (nil ifNil: [#foo] ifNotNil: [#bar]) = #foo! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:43'!
testIfNilIfNotNil0ArgAsVar

	| block1 block2 |
	block1 := [#foo].
	block2 := [#bar].
	self assert: (5 ifNil: block1 ifNotNil: block2) = #bar.
	self assert: (nil ifNil: block1 ifNotNil: block2) = #foo! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/15/2007 12:25'!
testIfNilIfNotNil1Arg

	self assert: (5 ifNil: [#foo] ifNotNil: [:a | a printString]) = '5'.
	self assert: (nil ifNil: [#foo] ifNotNil: [:a | a printString]) = #foo! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:33'!
testIfNilIfNotNil1ArgAsVar

	| block1 block2 |
	block1 := [#foo].
	block2 := [:a | a printString].
	self assert: (5 ifNil: block1 ifNotNil: block2) = '5'.
	self assert: (nil ifNil: block1 ifNotNil: block2) = #foo! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/15/2007 12:14'!
testIfNotNil0Arg

	self assert: (5 ifNotNil: [#foo]) = #foo.
	self assert: (nil ifNotNil: [#foo]) = nil! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:30'!
testIfNotNil0ArgAsVar

	| block |
	block := [#foo].
	self assert: (5 ifNotNil: block) = #foo.
	self assert: (nil ifNotNil: block) = nil! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/15/2007 12:15'!
testIfNotNil1Arg

	self assert: (5 ifNotNil: [:a | a printString]) = '5'.
	self assert: (nil ifNotNil: [:a | a printString]) = nil! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:31'!
testIfNotNil1ArgAsVar

	| block |
	block := [:a | a printString].
	self assert: (5 ifNotNil: block) = '5'.
	self assert: (nil ifNotNil: block) = nil! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:35'!
testIfNotNilIfNil0Arg

	self assert: (5 ifNotNil: [#foo] ifNil: [#bar]) = #foo.
	self assert: (nil ifNotNil: [#foo] ifNil: [#bar]) = #bar! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:36'!
testIfNotNilIfNil0ArgAsVar

	| block1 block2 |
	block1 := [#foo].
	block2 := [#bar].
	self assert: (5 ifNotNil: block2 ifNil: block1) = #bar.
	self assert: (nil ifNotNil: block2 ifNil: block1) = #foo! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:35'!
testIfNotNilIfNil1Arg

	self assert: (5 ifNotNil: [:a | a printString] ifNil: [#foo]) = '5'.
	self assert: (nil ifNotNil: [:a | a printString] ifNil: [#foo]) = #foo! !

!IfNotNilTests methodsFor: 'tests' stamp: 'vb 4/16/2007 11:36'!
testIfNotNilIfNil1ArgAsVar

	| block1 block2 |
	block1 := [#foo].
	block2 := [:a | a printString].
	self assert: (5 ifNotNil: block2 ifNil: block1) = '5'.
	self assert: (nil ifNotNil: block2 ifNil: block1) = #foo! !


!IfNotNilTests reorganize!
('tests' testIfNilIfNotNil0Arg testIfNilIfNotNil0ArgAsVar testIfNilIfNotNil1Arg testIfNilIfNotNil1ArgAsVar testIfNotNil0Arg testIfNotNil0ArgAsVar testIfNotNil1Arg testIfNotNil1ArgAsVar testIfNotNilIfNil0Arg testIfNotNilIfNil0ArgAsVar testIfNotNilIfNil1Arg testIfNotNilIfNil1ArgAsVar)
!

