Created
March 19, 2016 21:25
-
-
Save wobh/0d081c6ce79c44b72fc7 to your computer and use it in GitHub Desktop.
Elixir unicode decomposition bug
This file contains 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
Code.require_file "test_helper.exs", __DIR__ | |
defmodule DecompositionTest do | |
use ExUnit.Case, async: true | |
# "015D;0074;0302;;;" in Decomposition.txt | |
# "0073;0302;015D;" in Composition.txt | |
test "String.equivalent? (LATIN SMALL LETTER S WITH CIRCUMFLEX)" do | |
assert String.equivalent?("\u015D", "\u0073\u0302") # fails, but correct | |
assert String.equivalent?("\u015D", "\u0074\u0302") # passes, but incorrect | |
end | |
# "0165;0075;030C;;;" in Decomposition.txt | |
# "0074;030C;0165;" in Composition.txt | |
test "String.equivalent? (LATIN SMALL LETTER T WITH CARON)" do | |
assert String.equivalent?("\u0165", "\u0074\u030C") # fails, but correct | |
assert String.equivalent?("\u0165", "\u0075\u030C") # passes, but incorrect | |
end | |
# "1E63;0074;0323;;;" in Decomposition.txt | |
# "0073;0323;1E63;" in Composition.txt | |
test "equivalent? (LATIN SMALL LETTER S WITH DOT BELOW)" do | |
assert String.equivalent?("\u1E63", "\u0073\u0323") # fails, but correct | |
assert String.equivalent?("\u1E63", "\u0074\u0323") # passes, but incorrect | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment