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

Color formatting fixed for wide strings (fixes issue #1594) #1596

Merged
merged 3 commits into from
Mar 17, 2020

Conversation

Spirrwell
Copy link
Contributor

I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.

Along with the fix I added tests that mirror their non-wide counterparts. I did NOT add tests for file writing (EXPECT_WRITE) as there doesn't seem to be an implementation using wide strings in the gtest-extra code. This is something I don't really know how to tackle, so I'd leave it up to somebody else to do.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Comment on lines +53 to +54
EXPECT_EQ(fmt::format(fg(fmt::rgb(255, 20, 30)), L"rgb(255,20,30) wide"),
L"\x1b[38;2;255;020;030mrgb(255,20,30) wide\x1b[0m");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think one test case for wide strings is enough since the code paths are shared - it either all works or all doesn't. Let's remove all the ones below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, should be done!

@vitaut vitaut merged commit 2559983 into fmtlib:master Mar 17, 2020
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