diff options
Diffstat (limited to 'testes')
-rw-r--r-- | testes/coroutine.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 79bbf2ea..26ed1f6a 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
@@ -724,6 +724,17 @@ assert(run(function () return a / b end, {"div"}) == 10/12) | |||
724 | assert(run(function () return a % b end, {"mod"}) == 10) | 724 | assert(run(function () return a % b end, {"mod"}) == 10) |
725 | assert(run(function () return a // b end, {"idiv"}) == 0) | 725 | assert(run(function () return a // b end, {"idiv"}) == 0) |
726 | 726 | ||
727 | -- repeat tests with larger constants (to use 'K' opcodes) | ||
728 | local a1000 = new(1000) | ||
729 | |||
730 | assert(run(function () return a1000 + 1000 end, {"add"}) == 2000) | ||
731 | assert(run(function () return a1000 - 25000 end, {"sub"}) == -24000) | ||
732 | assert(run(function () return 2000 * a end, {"mul"}) == 20000) | ||
733 | assert(run(function () return a1000 / 1000 end, {"div"}) == 1) | ||
734 | assert(run(function () return a1000 % 600 end, {"mod"}) == 400) | ||
735 | assert(run(function () return a1000 // 500 end, {"idiv"}) == 2) | ||
736 | |||
737 | |||
727 | 738 | ||
728 | assert(run(function () return a % b end, {"mod"}) == 10) | 739 | assert(run(function () return a % b end, {"mod"}) == 10) |
729 | 740 | ||