Skip to content

normalization.t: Avoid non-ASCII characters in test names and notes#1157

Merged
marc-vanderwal merged 1 commit into
zonemaster:developfrom
marc-vanderwal:issue/#1153
Nov 30, 2022
Merged

normalization.t: Avoid non-ASCII characters in test names and notes#1157
marc-vanderwal merged 1 commit into
zonemaster:developfrom
marc-vanderwal:issue/#1153

Conversation

@marc-vanderwal

Copy link
Copy Markdown
Contributor

Purpose

This PR adds measures to avoid attempting to print non-ASCII characters in the names of (sub)tests and in the test notes. It does so by hex-escaping any character whose code point lies outside the U+0020–U+007F range.

It’s a quick-and-dirty fix just before a release. Maybe the code I introduced could be added to a “util” package later.

Context

Fixes #1153.

Changes

Avoid non-ASCII characters in test names and notes.

How to test this PR

Run the t/normalization.t unit test. No “Wide character in print” warning should appear anymore.

In order to avoid printing non-ASCII characters to STDOUT/STDERR, test
names and notes use strings converted to \x escape sequences.

This is a quick and dirty fix; maybe other places in the code could
benefit from this little conversion function.
@marc-vanderwal marc-vanderwal added the T-Bug Type: Bug in software or error in test case description label Nov 28, 2022
@marc-vanderwal marc-vanderwal added this to the v2022.2 milestone Nov 28, 2022
@marc-vanderwal

Copy link
Copy Markdown
Contributor Author

Let’s merge it, then.

@marc-vanderwal marc-vanderwal merged commit c701ba2 into zonemaster:develop Nov 30, 2022
@matsduf matsduf added the V-Patch Versioning: The change gives an update of patch in version. label Dec 13, 2022
@marc-vanderwal marc-vanderwal deleted the issue/#1153 branch September 5, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Bug Type: Bug in software or error in test case description V-Patch Versioning: The change gives an update of patch in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants