Skip to content

Commit

Permalink
Add test for equality of email addresses with unicode in the address …
Browse files Browse the repository at this point in the history
…part
sax committed May 31, 2024

Verified

This commit was signed with the committer’s verified signature.
sax Eric Saxby
1 parent 8252aec commit 4c05ac3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/ecto_email_test.exs
Original file line number Diff line number Diff line change
@@ -87,6 +87,14 @@ defmodule EctoEmailTest do
assert "[email protected]" |> EctoEmail.equal?("[email protected]")
end

test "handles unicode in the address part of emails" do
assert "😅@example.com" |> EctoEmail.equal?("😅@example.com")
assert "😅@example.COM" |> EctoEmail.equal?("😅@example.com")
assert "Ä@example.COM" |> EctoEmail.equal?("ä@example.com")

refute "😅@example.COM" |> EctoEmail.equal?("🥳@example.com")
end

test "is false when the addresses are the same" do
refute "[email protected]" |> EctoEmail.equal?("[email protected]")
end

0 comments on commit 4c05ac3

Please sign in to comment.