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 multi-code-unit characters to length validation tests #1092

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

adamthom-amzn
Copy link
Contributor

Issue #, if available: #1090

Description of changes:
Server implementations that naively use code units instead of code points to
evaluate length constraints will give incorrect results. This adds parameters
to the existing string length tests that use multi-code-unit characters to
generate strings that will meet the constraints if code units are counted,
but properly fail the constraints if code points are counted.

I tested this by running them without the fixes in smithy-lang/smithy-typescript#510 and observing that they fail, and then running them with the fixes and observing that they pass.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Server implementations that naively use code units instead of code points to
evaluate length constraints will give incorrect results. This adds parameters
to the existing string length tests that use multi-code-unit characters to
generate strings that will meet the constraints if code units are counted,
but properly fail the constraints if code points are counted.

Fixes smithy-lang#1090
@adamthom-amzn adamthom-amzn requested a review from a team as a code owner February 15, 2022 19:57
@adamthom-amzn adamthom-amzn merged commit b0b5213 into smithy-lang:main Feb 16, 2022
@adamthom-amzn adamthom-amzn deleted the length-updates branch February 16, 2022 18:28
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