Skip to content

tests/lapi: add debug tests #144

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

Merged
merged 1 commit into from
Jul 28, 2025
Merged

tests/lapi: add debug tests #144

merged 1 commit into from
Jul 28, 2025

Conversation

ligurio
Copy link
Owner

@ligurio ligurio commented Jul 7, 2025

No description provided.

@ligurio ligurio force-pushed the ligurio/gh-xxxx-lapi-debug branch from d90d076 to 33941a1 Compare July 8, 2025 08:23
@ligurio ligurio marked this pull request as draft July 8, 2025 09:36
@ligurio ligurio force-pushed the ligurio/gh-xxxx-lapi-debug branch from 33941a1 to fb812c7 Compare July 24, 2025 18:55
@ligurio ligurio marked this pull request as ready for review July 24, 2025 18:58
@ligurio ligurio force-pushed the ligurio/gh-xxxx-lapi-debug branch from fb812c7 to 775479f Compare July 24, 2025 19:08
ligurio added a commit to ligurio/lua-c-api-corpus that referenced this pull request Jul 24, 2025
@ligurio ligurio requested a review from Buristan July 24, 2025 19:14
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!
Please consider my comments below.

Maybe it is worth joining the tests into a single one, since the hook functionality and TestOneInput wrapper are the same for all tests.

@Buristan Buristan assigned ligurio and unassigned Buristan Jul 25, 2025
@ligurio ligurio force-pushed the ligurio/gh-xxxx-lapi-debug branch 3 times, most recently from 65d2ef2 to 08949ae Compare July 25, 2025 14:48
@ligurio ligurio requested a review from Buristan July 25, 2025 14:50
@ligurio ligurio assigned Buristan and unassigned ligurio Jul 25, 2025
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!

@Buristan Buristan assigned ligurio and unassigned Buristan Jul 25, 2025
ligurio added a commit to ligurio/lua-c-api-corpus that referenced this pull request Jul 28, 2025
The commit adds tests for the following functions in debug library:
`debug.getlocal()`, `debug.getupvalue()` and `debug.getinfo()`.
@ligurio ligurio force-pushed the ligurio/gh-xxxx-lapi-debug branch from 08949ae to 492a73e Compare July 28, 2025 12:36
@ligurio ligurio merged commit 9b870c8 into master Jul 28, 2025
12 checks passed
@ligurio ligurio deleted the ligurio/gh-xxxx-lapi-debug branch July 28, 2025 13:23
ligurio added a commit to ligurio/lua-c-api-corpus that referenced this pull request Jul 28, 2025
ligurio added a commit that referenced this pull request Jul 28, 2025
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 added a commit that referenced this pull request Jul 28, 2025
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 added a commit that referenced this pull request Jul 28, 2025
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
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