X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Femoji_test.exs;h=027a8132f768fa827f00ae6f41513a8ffc04086f;hb=aacd1c90b7422780ae1eb9030f9fd26d541d4a9c;hp=3070fb19f73220b6685a654fa379c291262a46f0;hpb=3b3cf63118b12e7dc57b65225ea96510d9ce48ab;p=akkoma
diff --git a/test/pleroma/emoji_test.exs b/test/pleroma/emoji_test.exs
index 3070fb19f..027a8132f 100644
--- a/test/pleroma/emoji_test.exs
+++ b/test/pleroma/emoji_test.exs
@@ -1,9 +1,9 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# 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
@@ -11,11 +11,20 @@ defmodule Pleroma.EmojiTest do
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?("ð³ï¸ââ§ï¸")
+
+ # Additionally, we accept regional indicators.
+ assert Emoji.is_unicode_emoji?("ðµ")
+ assert Emoji.is_unicode_emoji?("ð´")
+ assert Emoji.is_unicode_emoji?("ð¬")
end
end