Emoji: Add function to detect if a character is an emoji

This commit is contained in:
lain 2019-09-13 02:11:02 +02:00
commit a697f0d791
3 changed files with 802 additions and 0 deletions

View file

@ -6,6 +6,14 @@ defmodule Pleroma.EmojiTest do
use ExUnit.Case, async: true
alias Pleroma.Emoji
describe "is_unicode_emoji?/1" do
test "tells if a string is an unicode emoji" do
refute Emoji.is_unicode_emoji?("X")
assert Emoji.is_unicode_emoji?("")
assert Emoji.is_unicode_emoji?("🥺")
end
end
describe "get_all/0" do
setup do
emoji_list = Emoji.get_all()