aboutsummaryrefslogtreecommitdiff
path: root/testes/coroutine.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r--testes/coroutine.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua
index 182c1e18..36eae44a 100644
--- a/testes/coroutine.lua
+++ b/testes/coroutine.lua
@@ -1,4 +1,4 @@
1-- $Id: testes/coroutine.lua $ 1-- $Id: testes/coroutine.lua 2018-07-25 15:31:04 -0300 $
2-- See Copyright Notice in file all.lua 2-- See Copyright Notice in file all.lua
3 3
4print "testing coroutines" 4print "testing coroutines"
@@ -619,10 +619,8 @@ end
619 619
620assert(run(function () if (a>=b) then return '>=' else return '<' end end, 620assert(run(function () if (a>=b) then return '>=' else return '<' end end,
621 {"le", "sub"}) == "<") 621 {"le", "sub"}) == "<")
622-- '<=' using '<'
623mt.__le = nil
624assert(run(function () if (a<=b) then return '<=' else return '>' end end, 622assert(run(function () if (a<=b) then return '<=' else return '>' end end,
625 {"lt"}) == "<=") 623 {"le", "sub"}) == "<=")
626assert(run(function () if (a==b) then return '==' else return '~=' end end, 624assert(run(function () if (a==b) then return '==' else return '~=' end end,
627 {"eq"}) == "~=") 625 {"eq"}) == "~=")
628 626
@@ -677,7 +675,7 @@ do -- a few more tests for comparsion operators
677 return val(a) < val(b) 675 return val(a) < val(b)
678 end, 676 end,
679 } 677 }
680 local mt2 = { __lt = mt1.__lt } -- no __le 678 local mt2 = { __lt = mt1.__lt, __le = mt1.__le }
681 679
682 local function run (f) 680 local function run (f)
683 local co = coroutine.wrap(f) 681 local co = coroutine.wrap(f)