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

TEST_RANGE flatten error when only single argument #548

Open
KalleDK opened this issue Mar 23, 2021 · 2 comments
Open

TEST_RANGE flatten error when only single argument #548

KalleDK opened this issue Mar 23, 2021 · 2 comments

Comments

@KalleDK
Copy link

KalleDK commented Mar 23, 2021

This line seems to make trouble, if you only have on arg

arg_combinations.flatten.join(', ')

TEST_RANGE([0, 2, 1])
void testFlaf(int num) {}
undefined method `flatten' for 1:Integer (NoMethodError)
from ./generate_test_runner.rb:155:in `map'

If it's replaced with

if arg_combinations.kind_of?(Array)
    arg_combinations.flatten.join(', ')
else
    arg_combinations
end

I don't know ruby ! So if there is a more correct way - or something that I don't know please take this only as a suggestion

@erijo
Copy link
Contributor

erijo commented Apr 17, 2021

I made a PR for this, see #554.

@KalleDK
Copy link
Author

KalleDK commented Apr 18, 2021

Nice thanks - Your solution looks a bit better than mine :D

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

2 participants