-
Notifications
You must be signed in to change notification settings - Fork 3
tests/lapi: add builtin tests #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7a7d1f6
to
96bbfcc
Compare
47603ce
to
9957056
Compare
8800a82
to
7f7b4f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sergey!
Thanks for the patch!
Please consider my comments below.
Also, I suggest separating commits related to the math operations and builtin base library. Also, I suppose they should be performed for double range (not integer).
Done. |
ed16a67
to
afa9335
Compare
afa9335
to
c8a6bbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sergey!
Thanks for the fixes!
LGTM, after resolving ignorable nits above.
c8a6bbd
to
ab7e6e2
Compare
ab7e6e2
to
d16ef62
Compare
Follows up ligurio/lua-c-api-tests#139 Related to tarantool/tarantool#11470
Fixed assertion: --- a/tests/lapi/builtin_select_test.lua
+++ b/tests/lapi/builtin_select_test.lua
@@ -64,7 +64,9 @@ local function TestOneInput(buf)
local err_handler = test_lib.err_handler(ignored_msgs)
local ok, res = xpcall(select, err_handler, index, unpack(tbl))
if not ok then return end
- assert(type(res) == "number")
+ if index == "#" then
+ assert(type(res) == "number")
+ end
assert(res == count)
end
|
2ad4ffb
to
bc5bedd
Compare
Follows up ligurio/lua-c-api-tests#139 Related to tarantool/tarantool#11470
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sergey!
Thanks for the fixes.
LGTM after fixing the last nit below.
bc5bedd
to
096aba1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sergey!
Thanks for the fixes!
LGTM, after fixing the last nit below.
096aba1
to
a71dbb9
Compare
The `mktime()` function (which is used inside `os.time()`) returns -1 for cases when the time since the Epoch cannot be represented. In this case, `os.time()` returns `nil`: ``` luajit -e "print(os.time({year = 1970, month = 1, day = 1, sec = -9 * 60 * 60 - 1}))" nil ``` The patch fixes an assertion in the test and allows `nil` as a result of the function. Follows up #141
The function `string.pack()` raises, the patch wraps it by `xpcall()` and suppress errors with message "invalid format option". Follows up #124
The function `utf8.offset()` raises, the patch wraps it by `xpcall()` and suppress errors with message "initial position is a continuation byte". Follows up #143
Since commit 8e35f0c ("cmake: bump luzer version") `fdp:oneof()` in luzer API returns two values: a table's item and it's index. This breaks test `debug_torture_test.lua` with a message below > bad argument #2 to 'insert' (number expected, got string) because `fdp:one()` passed to `table.insert()` makes a call with three arguments: table, hook mask ("string") and index ("number"), while `table.insert()` with three arguments expects table, `pos` ("number"), and a value (any type). Follows up #144
The commit adds tests for Lua 5.1 builtin functions except the following functions: `print`, `pcall`, `xpcall`, `type`.
a71dbb9
to
cffa36d
Compare
Follows up ligurio/lua-c-api-tests#139 Related to tarantool/tarantool#11470
Depends on #142