-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix nfd normalization bug #4606
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -378,7 +378,7 @@ defmodule StringTest do | |
|
|
||
| test "normalize" do | ||
| assert String.normalize("ŝ", :nfd) == "ŝ" | ||
| assert String.normalize("ḇravô", :nfd) == "ḇravô" | ||
| assert String.normalize("ḇravô", :nfd) == "ḇravô" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if there is a way to view these differently in the console. Visually I don't see anything different. Its not until you look at the binary representation or the codepoints that an assessment can be made as by they are failing. test normalize (StringTest)
lib/elixir/test/elixir/string_test.exs:379
Assertion with == failed
code: String.normalize("ḇravô", :nfd) == "ḇravô"
lhs: "ḇravô"
rhs: "ḇravô"
diff: "ḇravôô"
stacktrace:
lib/elixir/test/elixir/string_test.exs:382: (test)Console output <<"ḇravô">> <> <<0>> = <<98, 204, 177, 114, 97, 118, 111, 204, 130, 0>> # lhs
<<"ḇravô">> <> <<0>> = <<98, 204, 177, 114, 97, 118, 195, 180, 0>> # rhsThis does make it difficult to diagnose a test failure. |
||
| assert String.normalize("ṩierra", :nfd) == "ṩierra" | ||
| assert String.normalize("뢴", :nfd) == "뢴" | ||
| assert String.normalize("êchǭ", :nfc) == "êchǭ" | ||
|
|
||
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.
💁 Don't know if this is the right place to change this but it seems incorrect.