Skip to content

Commit

Permalink
Ensure that emoji can't be looked up by their text glyph
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 3, 2019
1 parent fd84af5 commit 37b14e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/emoji_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ class EmojiTest < TestCase
message = "Missing or incorrect unicodes:\n"
source_unicode_emoji.each do |emoji|
emoji[:sequences].each do |raw|
next if text_glyphs.include?(raw) || Emoji.find_by_unicode(raw)
found = Emoji.find_by_unicode(raw)
if text_glyphs.include?(raw)
assert_nil found, Emoji::Character.hex_inspect(raw)
next
end
next if found
message << "%s (%s)" % [Emoji::Character.hex_inspect(raw), emoji[:description]]
if found = Emoji.find_by_unicode(raw.gsub("\u{fe0f}", ""))
message << " - could be %s (:%s:)" % [found.hex_inspect, found.name]
Expand Down

0 comments on commit 37b14e4

Please sign in to comment.