forked from cucumber/cucumber-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Sync with upstream [24.08.2021] #10
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json_spirit's escaping of multibyte characters creates bugs in the WireProtocol which prevent usage of valid UTF-8 encoded characters in step definitions relying on RegEx. The new tests: /features/specific/wire_encoding.feature /tests/integration/WireProtocolTest.cpp /tests/unit/RegexTest.cpp
This change updates json-spirit to the latest public version: https://www.codeproject.com/KB/recipes/JSON_Spirit/json_spirit_v4.08.zip 4.08 adds support for a raw_utf8 option when writing a JSON string. Previously, multibyte characters were being escaped when being sent from cucumber-cpp to cucumber-ruby. Because cucumber-ruby's wire decoder does not properly decode escaped character sequences, this would crash cucumber-ruby.
This modifies the WireResponseEncoder to always use the raw_utf8 option provided by the new version of json_spirit. According to the IETF RFC8259: "JSON text exchanged between systems that are not part of a closed ecosystem MUST be encoded using UTF-8 [RFC3629]." https://tools.ietf.org/html/rfc8259
`cucumber-ruby` expects position values which are based on the index of the codepoint instead of the index of the code unit. This change modifies the value returned to `cucumber-ruby`. Prior to this change, the RegexSubMatch's position, which was correct in terms of a code unit array, would cause an `index out of string` error and crash cucumber-ruby when pretty-printing the results of a test. This commit also ammends the added tests to demonstrate the corrected behavior.
Fix compilation with Boost 1.70.0
…-upstream Support step definitions with multi-byte characters
ala-ableton
approved these changes
Aug 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
When you want to merge, please do not press the "Merge pull request" button (and do not use @ablbot merge). Instead, push edf5a29 directly to ableton-master.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings Ableton's
cucumber-cppup to date with a change allowing for the use of non-basic latincharacters in step definitions.Details
cucumber/cucumber-cpp#224was merged, allowing for step definitions to use non-basic latincharacters. This enables us to write acceptance tests to protect against regressions of our support for languages whose character sets are encoded in UTF-8.Motivation and Context
We want the ability to test scenarios which involve non-
basic latincharacters.How Has This Been Tested?
The code change was merged upstream following the
cucumber-cppproject's testing process.Types of changes
Checklist: