Sha256: 1a33203484bf332d6174ddcbedf1b5b7a11461e2d16b7640d9db0536bfdf6de4

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

require_relative "../lib/unicode/sequence_name"
require "minitest/autorun"

describe Unicode::SequenceName do
  describe ".sequence_name (alias .of)" do
    it "will return name for that sequence name" do
      assert_equal "DOUBLE EXCLAMATION MARK (text style)", Unicode::SequenceName.of("‼︎")
      assert_equal "CJK COMPATIBILITY IDEOGRAPH-2F81F", Unicode::SequenceName.of("㓟︀")
      assert_equal "MYANMAR LETTER NGA (dotted form)", Unicode::SequenceName.of("င︀")
      assert_equal "TAMIL SYLLABLE NI", Unicode::SequenceName.of("நி")
      assert_equal "FLAG: UNITED NATIONS", Unicode::SequenceName.of("🇺🇳")
      assert_equal "FLAG: SCOTLAND", Unicode::SequenceName.of("🏴󠁧󠁢󠁳󠁣󠁴󠁿")
      assert_equal "PERSON: CURLY HAIR", Unicode::SequenceName.of("🧑‍🦱") # Emoji 12.1
      assert_equal "MAN FEEDING BABY", Unicode::SequenceName.of("👨‍🍼") # Emoji 13.0
      assert_equal "HEART ON FIRE", Unicode::SequenceName.of("❤️‍🔥") # Emoji 13.1
      assert_equal "HANDSHAKE: LIGHT SKIN TONE, MEDIUM-DARK SKIN TONE", Unicode::SequenceName.of("🫱🏻‍🫲🏾") # Emoji 14.0
      assert_equal "BLACK BIRD", Unicode::SequenceName.of("🐦‍⬛") # Emoji 15.0
    end

    it "will return nil for characters without name" do
      assert_nil Unicode::SequenceName.of("\u{10c50}")
      assert_nil Unicode::SequenceName.of("bla")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unicode-sequence_name-1.12.0 spec/unicode_sequence_name_spec.rb
unicode-sequence_name-1.11.0 spec/unicode_sequence_name_spec.rb