Skip to content

Introduce oneof() in FuzzedDataProvider #26

Merged
ligurio merged 3 commits intomasterfrom
ligurio/gh-xxxx-fdp-oneof
Apr 8, 2025
Merged

Introduce oneof() in FuzzedDataProvider #26
ligurio merged 3 commits intomasterfrom
ligurio/gh-xxxx-fdp-oneof

Conversation

@ligurio
Copy link
Copy Markdown
Owner

@ligurio ligurio commented Mar 22, 2025

Depends on #34

@ligurio ligurio force-pushed the ligurio/gh-xxxx-fdp-oneof branch 3 times, most recently from 6ba4e50 to 48f80a8 Compare March 23, 2025 08:48
Copy link
Copy Markdown
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.

@ligurio ligurio force-pushed the ligurio/gh-xxxx-fdp-oneof branch 3 times, most recently from 15963aa to 83473a7 Compare April 8, 2025 14:08
@ligurio ligurio requested a review from Buristan April 8, 2025 14:17
@ligurio ligurio force-pushed the ligurio/gh-xxxx-fdp-oneof branch from 83473a7 to 307c5b9 Compare April 8, 2025 16:04
ligurio added 3 commits April 8, 2025 19:12
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`.
@ligurio ligurio force-pushed the ligurio/gh-xxxx-fdp-oneof branch from 307c5b9 to 347703a Compare April 8, 2025 16:15
@ligurio ligurio merged commit d2cb24d into master Apr 8, 2025
10 checks passed
@ligurio ligurio deleted the ligurio/gh-xxxx-fdp-oneof branch April 8, 2025 16:19
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