Sha256: e14b8c4a1b1fb6e5ef3df911ba81493144f47b791beafe2d766e32948a12d303

Contents?: true

Size: 905 Bytes

Versions: 6

Compression:

Stored size: 905 Bytes

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 "UNITED NATIONS", Unicode::SequenceName.of("🇺🇳")
      assert_equal "SCOTLAND", Unicode::SequenceName.of("🏴󠁧󠁢󠁳󠁣󠁴󠁿")
    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

6 entries across 6 versions & 1 rubygems

Version Path
unicode-sequence_name-1.2.0 spec/unicode_sequence_name_spec.rb
unicode-sequence_name-1.1.2 spec/unicode_sequence_name_spec.rb
unicode-sequence_name-1.1.1 spec/unicode_sequence_name_spec.rb
unicode-sequence_name-1.1.0 spec/unicode_sequence_name_spec.rb
unicode-sequence_name-1.0.1 spec/unicode_sequence_name_spec.rb
unicode-sequence_name-1.0.0 spec/unicode_sequence_name_spec.rb