Skip to content
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

4 arguments #24

Open
frr149 opened this issue Nov 30, 2022 · 2 comments
Open

4 arguments #24

frr149 opened this issue Nov 30, 2022 · 2 comments

Comments

@frr149
Copy link

frr149 commented Nov 30, 2022

Is there any workaround when you need 4 inputs, or should I create a Glados4 class and submit a pull request?

@MarcelGarus
Copy link
Owner

You can always use a custom generator to generate more inputs, like this:

Glados(
  any.combine4(any.int, any.int, any.int, (a, b, c, d) => [a, b, c, d])
).test(description, (input) {
  final a = input[0] as int;
  final b = input[1] as int;
  final c = input[2] as int;
  final d = input[3] as int;
  // stuff
});

But yes, in the long term, the cleaner approach would be to create a PR for a Glados 4 class.

@tjarvstrand
Copy link
Contributor

FWIW, I think providing extensions for record types would be a nice touch! That way, we could simply write something like:

(any.int, any.int, any.int, any.int).test(description, (input) {
  // stuff
});

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

No branches or pull requests

3 participants