test logical short-circuit cases (#27)
parent
fb6158a1c0
commit
aa3deef01b
@ -0,0 +1,6 @@
|
|||||||
|
local x = nil
|
||||||
|
local x_ = (x and x.k or "fallback")
|
||||||
|
assert(x_ == "fallback")
|
||||||
|
local y = "ok"
|
||||||
|
local y_ = (y or error("should not raise"))
|
||||||
|
assert(y == y_)
|
||||||
Loading…
Reference in new issue