diff options
author | daurnimator <quae@daurnimator.com> | 2020-07-09 23:00:31 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2020-07-09 23:00:31 +1000 |
commit | 03b115b01613c76cc1ee88d9eba806ef5c54281a (patch) | |
tree | b68489fd969b5762e9ebf34b5b9c6076879a8daa /vendor/compat53/tests/test.lua | |
parent | 2ae0a68ef20f638587a9423770e488198d703fd0 (diff) | |
parent | 1baeacb17e1dccc843a0f25579a22c68d5a8a1e1 (diff) | |
download | luaossl-03b115b01613c76cc1ee88d9eba806ef5c54281a.tar.gz luaossl-03b115b01613c76cc1ee88d9eba806ef5c54281a.tar.bz2 luaossl-03b115b01613c76cc1ee88d9eba806ef5c54281a.zip |
Merge branch '5.4'
Diffstat (limited to 'vendor/compat53/tests/test.lua')
-rwxr-xr-x | vendor/compat53/tests/test.lua | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/vendor/compat53/tests/test.lua b/vendor/compat53/tests/test.lua index c2c0abf..0640cae 100755 --- a/vendor/compat53/tests/test.lua +++ b/vendor/compat53/tests/test.lua @@ -664,14 +664,12 @@ print("isinteger", mod.isinteger(12.3)) print("isinteger", mod.isinteger(math.huge)) print("isinteger", mod.isinteger(math.sqrt(-1))) - ___'' print("rotate", mod.rotate(1, 1, 2, 3, 4, 5, 6)) print("rotate", mod.rotate(-1, 1, 2, 3, 4, 5, 6)) print("rotate", mod.rotate(4, 1, 2, 3, 4, 5, 6)) print("rotate", mod.rotate(-4, 1, 2, 3, 4, 5, 6)) - ___'' print("strtonum", mod.strtonum("+123")) print("strtonum", mod.strtonum(" 123 ")) @@ -679,7 +677,6 @@ print("strtonum", mod.strtonum("-1.23")) print("strtonum", mod.strtonum(" 123 abc")) print("strtonum", mod.strtonum("jkl")) - ___'' local a, b, c = mod.requiref() print("requiref", type(a), type(b), type(c), @@ -687,6 +684,34 @@ print("requiref", type(a), type(b), type(c), type(requiref1), type(requiref2), type(requiref3)) ___'' +local c = coroutine.wrap(function() + mod.extraspace("uvw") + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) +end) +c() +mod.extraspace("abc") +print("getextraspace", mod.extraspace()) +c() +local d = coroutine.wrap(function() + print("getextraspace", mod.extraspace()) + mod.extraspace("xyz") + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) +end) +d() +print("getextraspace", mod.extraspace()) +mod.extraspace("123") +c() +d() + +___'' local proxy, backend = {}, {} setmetatable(proxy, { __index = backend, __newindex = backend }) print("geti/seti", rawget(proxy, 1), rawget(backend, 1)) @@ -705,7 +730,7 @@ print("tonumber", mod.tonumber("error")) ___'' print("tointeger", mod.tointeger(12)) -print("tointeger", mod.tointeger(-12)) +print("tointeger", mod.tointeger(12)) print("tointeger", mod.tointeger(12.1)) print("tointeger", mod.tointeger(12.9)) print("tointeger", mod.tointeger(-12.1)) |