-
Notifications
You must be signed in to change notification settings - Fork 3
Fix Lua API tests #153
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
Fix Lua API tests #153
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cfeb442
cmake: bump luzer
ligurio 5d2ee02
tests/lapi: fix table_remove_test
ligurio 1afca94
tests/lapi: fix string_byte_test
ligurio ef021a8
tests/lapi: fix string_rep_test
ligurio b86cd65
tests/lapi: fix formatting
ligurio 2d00c57
tests/lapi: cache locales in random_locale()
ligurio 35b6dc8
tests/lapi: add table.clear test
ligurio e616e6f
tests/lapi: update assertions in os tests
ligurio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--[[ | ||
SPDX-License-Identifier: ISC | ||
Copyright (c) 2023-2025, Sergey Bronnikov. | ||
|
||
Double-emitting of IR_NEWREF for the same key on the snap replay, | ||
https://github.com/LuaJIT/LuaJIT/issues/1128 | ||
|
||
X86/X64 load fusion conflict detection doesn't detect table.clear, | ||
https://github.com/LuaJIT/LuaJIT/issues/1117 | ||
|
||
Problem of HREFK with table.clear, | ||
https://github.com/LuaJIT/LuaJIT/issues/792 | ||
|
||
Add support for freeing memory manually, | ||
https://github.com/LuaJIT/LuaJIT/issues/620 | ||
|
||
Synopsis: table.clear(tbl) | ||
]] | ||
|
||
local luzer = require("luzer") | ||
local test_lib = require("lib") | ||
|
||
if test_lib.lua_version() ~= "LuaJIT" then | ||
print("Unsupported version.") | ||
os.exit(0) | ||
end | ||
|
||
local table_clear = require("table.clear") | ||
|
||
local function TestOneInput(buf) | ||
local fdp = luzer.FuzzedDataProvider(buf) | ||
local count = fdp:consume_integer(0, test_lib.MAX_INT64) | ||
local tbl = fdp:consume_strings(test_lib.MAX_STR_LEN, count) | ||
table_clear(tbl) | ||
-- Make sure the table is empty. | ||
local n_items = 0 | ||
for _ in pairs(tbl) do | ||
n_items = n_items + 1 | ||
end | ||
assert(n_items == 0) | ||
end | ||
|
||
local args = { | ||
artifact_prefix = "table_clear_", | ||
} | ||
luzer.Fuzz(TestOneInput, nil, args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be nice to check that there are no keys in this table after clearing.
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.
Updated:
Uh oh!
There was an error while loading. Please reload this page.
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.
Minor: s/
_, _
/_
/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.
Fixed: