Skip to content

Improve String generation - #385

Merged
regadas merged 1 commit into
mainfrom
oscar/small_string_gen
Feb 26, 2022
Merged

Improve String generation#385
regadas merged 1 commit into
mainfrom
oscar/small_string_gen

Conversation

@johnynek

Copy link
Copy Markdown
Contributor

Previously we were using scalacheck Arbitrary.arbitrary[String] which generates strings from a huge space. The problem is that the chance you randomly generate anything that will parse will be very low.

Here we improve is somewhat by choosing strings from three spaces: ('a', 'A', 'b', 'B', ' '), printable ascii, and all unicode.

The idea is that some laws that might not fail for all unicode (because we just generate parsers and strings that never match) might fail if we restrict the string space enough.

No tests failed, but still I think it is better.

@johnynek

Copy link
Copy Markdown
Contributor Author

what do you think @regadas ?

@regadas regadas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I think this is better too! 👍

@regadas
regadas merged commit 8816125 into main Feb 26, 2022
@regadas
regadas deleted the oscar/small_string_gen branch February 26, 2022 00:54
i10416 pushed a commit to i10416/cats-parse that referenced this pull request Mar 20, 2022
i10416 pushed a commit to i10416/cats-parse that referenced this pull request Mar 20, 2022
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