simple block
0 $mock::
test.diesel.block6
a.a
. (ctx[="res6"]
="ok"
)
send::
msg test.diesel.block6
expect:: (res6 is "ok"
)
0 $mock::
test.diesel.block16
a.a
$ifc:: (1 == 1) do.this
. (ctx[="res16"]
="ok"
)
b.b
send::
msg test.diesel.block16
expect:: (res16 is "ok"
)
0 $mock::
test.diesel.block29
a.a
$ifc:: (1 == 1) do.this
. (ctx[="res29"]
="ok"
)
$ifc:: (1 == 1) do.this
. (ctx[="res29"]
=(res29 + "ok")
)
send::
msg test.diesel.block29
expect:: (res29 is "okok"
)
0 $mock::
test.diesel.block46
a.a
$ifc:: (a46 == 1) do.this
. (ctx[="res46"]
="ok"
)
$else:: do.that
. (ctx[="res46"]
="notok"
)
b.b
send::
msg test.diesel.block46 (a46:Number=1
)
expect:: (res46 is "ok"
)
send::
msg test.diesel.block46 (a46:Number=2
)
expect:: (res46 is "notok"
)
$mock test.diesel.block66 $if (a == a) { if (1 == 1) { (ctx.res66 = "ok") } }
send::
msg test.diesel.block66 (a:Number=2
)
expect:: (res66 is "ok"
)
0 $mock::
test.diesel.block78
$ifc:: (1 == 1) do.this
. (ctx[="res78"]
="ok"
)
send::
msg test.diesel.block78 (a:Number=2
)
expect:: (res78 is "ok"
)
$mock test.diesel.block90 (level) { if (level >= 1) { (res90 = 1) if (level >= 2) { (res90 = 2) } else { (res90 = 3) } } else { (res90 = 4) } }
send::
msg test.diesel.block90 (level:Number=0
)
expect:: (res90 is 4
)
send::
msg test.diesel.block90 (level:Number=1
)
expect:: (res90 is 3
)
send::
msg test.diesel.block90 (level:Number=2
)
expect:: (res90 is 2
)
send::
msg test.diesel.block90 (level:Number=1.5
)
expect:: (res90 is 3
)
$mock test.diesel.block99 { (res99 = 1)
// diesel.try // diesel.throw (exception="SQL") // see known issues - this will fail test.diesel.throw
diesel.catch { (res99 = 2) } }
send::
msg test.diesel.block99
expect:: (res99 is 2
)
$when::
test.diesel.throw
. (x
=(4 / 0)
)
diesel.throw (msg="SQL"
="SQL")
You need to log in to post a comment!