1 IfTest
:= UnitTest
clone do(
4 Object if := method(condition,
5 index = if(condition, 1, 2)
6 if(call message arguments size > index,
7 call sender doMessage(call message argAt(index), call sender)
9 if(condition, true, false)
24 testTrueExpression
:= method(
25 assertEquals(if(true
, 1), 1)
28 testTrue2Expressions
:= method(
29 assertEquals(if(true
, 1, 2), 1)
33 assertFalse(if(false
))
36 testFalseExpression
:= method(
37 assertFalse(if(false
, 1))
40 testFalse2Expressions
:= method(
41 assertEquals(if(false
, 1, 2), 2)
50 testOtherTrue
:= method(
51 assertTrue(if(Object))