+ exponents are now valid: 1.212121e+18
[io/quag.git] / libs / iovm / tests / IfTest.io
blobd21d69f0bf34b13a755f12a55ac9c604a44bfbd8
1 IfTest := UnitTest clone do(
3 /*
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)
14 testIfEval := method(
15 v := false
16 if(v := true)
17 assertTrue(v)
20 testTrue := method(
21 assertTrue(if(true))
24 testTrueExpression := method(
25 assertEquals(if(true, 1), 1)
28 testTrue2Expressions := method(
29 assertEquals(if(true, 1, 2), 1)
32 testFalse := method(
33 assertFalse(if(false))
36 testFalseExpression := method(
37 assertFalse(if(false, 1))
40 testFalse2Expressions := method(
41 assertEquals(if(false, 1, 2), 2)
44 testNil := method(
45 assertFalse(if)
46 assertFalse(if())
47 assertFalse(if(nil))
50 testOtherTrue := method(
51 assertTrue(if(Object))
52 assertTrue(if(13))
53 assertTrue(if("foo"))