Sha256: 52b2827c3ac6119d301fe572bf98136fffe9908f182bb10de0b0b06314c7a450

Contents?: true

Size: 637 Bytes

Versions: 4

Compression:

Stored size: 637 Bytes

Contents

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

describe Unicode::Confusable do
  it "will detect official confusables" do
    assert_equal true, Unicode::Confusable.confusable?("1", "l")
    assert_equal true, Unicode::Confusable.confusable?("ℜ𝘂ᖯʏ", "Ruby")
    assert_equal true, Unicode::Confusable.confusable?("Michael", "Michae1")
    assert_equal true, Unicode::Confusable.confusable?("⁇", "??")
  end

  it "will return false for non-confusables" do
    assert_equal false, Unicode::Confusable.confusable?("a", "b")
    assert_equal false, Unicode::Confusable.confusable?("⁇", "?")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unicode-confusable-1.2.0 spec/unicode_confusable_spec.rb
unicode-confusable-1.1.0 spec/unicode_confusable_spec.rb
unicode-confusable-1.0.1 spec/unicode_confusable_spec.rb
unicode-confusable-1.0.0 spec/unicode_confusable_spec.rb