-
Notifications
You must be signed in to change notification settings - Fork 3
Fix lapi tests #150
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
Fix lapi tests #150
Conversation
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-set.
I'll continue with the review per-patch below.
[PATCH 1/4] tests/lapi: fix os_time_test
Thanks for the patch!
Please consider my comment below.
It would be nice to add the more verbose description in the commit message as well.
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.
[PATCH 2/4] tests/lapi: fix string_pack_test
Thanks for the patch!
Please consider my comment below.
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.
[PATCH 3/4] tests/lapi: fix utf8_offset_test
Thanks for the patch!
LGTM.
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.
[PATCH 4/4] tests/lapi: fix debug_torture_test
Thanks for the patch!
LGTM!
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
eca75a5
to
87efa8e
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.
Sergey,
Thanks for the fixes!
LGTM!
No description provided.