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

Split parameters #11

Closed
Callemul opened this issue Apr 14, 2016 · 6 comments
Closed

Split parameters #11

Callemul opened this issue Apr 14, 2016 · 6 comments

Comments

@Callemul
Copy link

Hello! I liked your lib and included to my project, but...

I have one test case with this annotation. And I have exception.

@TestWith("ф5,9", "ф5.9", "3" )

image

image

I a little debugged your code.
"ф5,9" is a one of my parameters, it doesn't want to be splitted))

image

image

What can I do for you to understand this issue?

@piotrturski
Copy link
Owner

user guide may help: https://github.com/piotrturski/zohhak/blob/master/Full-Guide.md#commas-white-chars-apostrophes
does it solve your problem?

@Callemul
Copy link
Author

Callemul commented Apr 15, 2016

Dear, piotrturski. I'm glad that you are here. It was a good guess. But...

This link says "contains parameter 'separator' ". But I need only one parameter for my function. And this function must be passed three times by: "ф5,9", "ф5.9", "3". It equal three test cases. The current your link wants create only one test case, when I need three.

Please, look at this my crazy queue (all of them want to be passed by function, where one parameter. One by one they all will be passed to the function):
image

And I must pass strings, where Double might be written separated by '.' (dot) or ',' (comma). The string don't wants be changed.

Test case#1: $100,5 -> 100.5
Test case#2: $100.5 -> 100.5

Thank you for your attention!

@piotrturski
Copy link
Owner

piotrturski commented Apr 15, 2016

zohhak splits your input string into parameters using separator. every time it finds a separator it will make a split and therefore create another parameter. the default separator is a comma. if you don't want to split your input, you have two options: remove default separator (comma) from your input or tell zohhak to use different separator. the link shows how to do the second

@Callemul
Copy link
Author

Callemul commented Apr 15, 2016

Thanks! I added separator "&"

As for me, the ideal solution is change default comma to "&", because every time I need to write an excessive code: , separator = "&"

image

Well, any way, thanks for all!

It solve my issue for some time. Good luck!

@piotrturski
Copy link
Owner

if you want to avoid copy/pasting your configuration, user guide may help: https://github.com/piotrturski/zohhak/blob/master/Full-Guide.md#drying-configuration

@Callemul
Copy link
Author

It was good. Thanks!

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