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

Add generators for UTF-8 strings #319

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

kostis
Copy link
Collaborator

@kostis kostis commented Jan 21, 2025

As reported in #318, proper_types:string() may generate invalid Unicode strings; the Erlang type language overapproximates the set of character lists that represent valid Unicode strings.

This PR extends the proper_unicode module with functions that generate valid UTF-8 character lists.

Like most proper_types generators, these functions are auto-imported and thus one can write

   ?FORALL(Str, utf8_string(), ...)

without having to specify the proper_unicode: module prefix.

Closes #318

As reported in proper-testing#318, `proper_types:string()` may generate invalid Unicode
strings; the Erlang type language overapproximates the set of lists that
represent valid Unicode strings.

This `proper_unicode` module is therefore extended with functions that
generate valid UTF-8 character lists.
@kostis
Copy link
Collaborator Author

kostis commented Jan 31, 2025

There has not been any feedback, so I will interpret this as an OK for this PR. Merging.

@kostis kostis merged commit b55f7df into proper-testing:master Jan 31, 2025
15 checks passed
@kostis kostis deleted the utf8-string branch January 31, 2025 11:45
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.

proper_types:char() and proper_types:string() may generate invalid Unicode
1 participant