Skip to content

Conversation

ligurio
Copy link
Owner

@ligurio ligurio commented Jul 28, 2025

No description provided.

Copy link
Collaborator

@Buristan Buristan left a 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.

Copy link
Collaborator

@Buristan Buristan left a 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.

Copy link
Collaborator

@Buristan Buristan left a 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.

Copy link
Collaborator

@Buristan Buristan left a 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!

ligurio added 4 commits July 28, 2025 18:13
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
@ligurio ligurio force-pushed the ligurio/gh-xxxx-fix-lapi-tests branch from eca75a5 to 87efa8e Compare July 28, 2025 15:22
@ligurio ligurio requested a review from Buristan July 28, 2025 15:23
Copy link
Collaborator

@Buristan Buristan left a 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!

@ligurio ligurio merged commit 972406b into master Jul 28, 2025
12 checks passed
@ligurio ligurio deleted the ligurio/gh-xxxx-fix-lapi-tests branch July 28, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants