aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/compat53/tests
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-07-08 20:27:02 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-07-08 20:27:02 +1000
commit5b7f74d3cb2260b110bcd3308f782f65b4d9565f (patch)
tree4f4e46c7a9934757738bca7b85d34e0796f2d1f7 /vendor/compat53/tests
parentc72a963097b994d5dcaf3197ba45896a2a637885 (diff)
parent942e9fb5c80368fe93ca195bc14272b2d4cd2881 (diff)
downloadluaossl-5b7f74d3cb2260b110bcd3308f782f65b4d9565f.tar.gz
luaossl-5b7f74d3cb2260b110bcd3308f782f65b4d9565f.tar.bz2
luaossl-5b7f74d3cb2260b110bcd3308f782f65b4d9565f.zip
Merge lua-compat-5.3 v0.7
Diffstat (limited to 'vendor/compat53/tests')
-rwxr-xr-xvendor/compat53/tests/test.lua5
-rw-r--r--vendor/compat53/tests/testmod.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/vendor/compat53/tests/test.lua b/vendor/compat53/tests/test.lua
index 2f6c7f6..c2c0abf 100755
--- a/vendor/compat53/tests/test.lua
+++ b/vendor/compat53/tests/test.lua
@@ -705,6 +705,11 @@ print("tonumber", mod.tonumber("error"))
___''
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))
+print("tointeger", mod.tointeger(-12.9))
print("tointeger", mod.tointeger("12"))
print("tointeger", mod.tointeger("0"))
print("tointeger", mod.tointeger(math.pi))
diff --git a/vendor/compat53/tests/testmod.c b/vendor/compat53/tests/testmod.c
index a0d2e2a..cd56e76 100644
--- a/vendor/compat53/tests/testmod.c
+++ b/vendor/compat53/tests/testmod.c
@@ -152,7 +152,8 @@ static int test_tointeger (lua_State *L) {
lua_pushnil(L);
else
lua_pushinteger(L, n);
- return 1;
+ lua_pushinteger(L, lua_tointeger(L, 1));
+ return 2;
}
static int test_len (lua_State *L) {
@@ -225,9 +226,9 @@ static int test_uservalue (lua_State *L) {
int ui = lua_gettop(L);
lua_newtable(L);
lua_setuservalue(L, ui);
- lua_getuservalue(L, ui);
+ lua_pushinteger(L, lua_getuservalue(L, ui));
(void)udata;
- return 1;
+ return 2;
}
static int test_upvalues (lua_State *L) {