Introduce oneof() in FuzzedDataProvider #26
Merged
Conversation
6ba4e50 to
48f80a8
Compare
Buristan
requested changes
Apr 7, 2025
Collaborator
Buristan
left a comment
There was a problem hiding this comment.
Hi, Sergey!
Thanks for the patch!
Please consider my comments below.
15963aa to
83473a7
Compare
83473a7 to
307c5b9
Compare
All FDP methods contains a condition with check for `lfdp` userdata object, but this check is always false, because `lfdp` is checked previously by `luaL_checkudata()`. The patch removes these conditions.
Pass an index of the table in `table_nkeys()` via arguments. Follows up commit d777927 ("luzer: fix argv building").
The patch introduces a new FDP method - `oneof()`, it returns
a random element in the specified Lua array:
```
> fdp:oneof({'clickhouse', 'ydb', 'tarantool'})
---
- tarantool
...
>
```
`oneof()` with empty table returns a `nil`.
307c5b9 to
347703a
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on #34