projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
non condition dir creation
[akkoma]
/
test
/
pleroma
/
emoji_test.exs
diff --git
a/test/pleroma/emoji_test.exs
b/test/pleroma/emoji_test.exs
index 65f575fd44c003629ba41ed02d3743174b83a58f..c99c9ef4c863fde77a2291df7b5ea2da455dedbf 100644
(file)
--- a/
test/pleroma/emoji_test.exs
+++ b/
test/pleroma/emoji_test.exs
@@
-3,7
+3,7
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.EmojiTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.EmojiTest do
- use ExUnit.Case
+ use ExUnit.Case
, async: true
alias Pleroma.Emoji
describe "is_unicode_emoji?/1" do
alias Pleroma.Emoji
describe "is_unicode_emoji?/1" do
@@
-11,10
+11,20
@@
defmodule Pleroma.EmojiTest do
refute Emoji.is_unicode_emoji?("X")
refute Emoji.is_unicode_emoji?("ね")
refute Emoji.is_unicode_emoji?("X")
refute Emoji.is_unicode_emoji?("ね")
- assert Emoji.is_unicode_emoji?("☂")
+ # Only accept fully-qualified (RGI) emoji
+ # See http://www.unicode.org/reports/tr51/
+ refute Emoji.is_unicode_emoji?("❤")
+ refute Emoji.is_unicode_emoji?("☂")
+
assert Emoji.is_unicode_emoji?("🥺")
assert Emoji.is_unicode_emoji?("🤰")
assert Emoji.is_unicode_emoji?("❤️")
assert Emoji.is_unicode_emoji?("🥺")
assert Emoji.is_unicode_emoji?("🤰")
assert Emoji.is_unicode_emoji?("❤️")
+ assert Emoji.is_unicode_emoji?("🏳️⚧️")
+
+ # Additionally, we accept regional indicators.
+ assert Emoji.is_unicode_emoji?("🇵")
+ assert Emoji.is_unicode_emoji?("🇴")
+ assert Emoji.is_unicode_emoji?("🇬")
end
end
end
end