Sha256: 865a6c538d97bde717d4c898f5e57d895e52c53cca3ca4786ac47fb98d6133b4

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 Bytes

Contents

#! /usr/bin/ruby
# encoding: utf-8

require 'minitest/autorun'

describe "y_support/unicode" do
  before do
    require_relative '../lib/y_support/unicode'
  end

  it "should define a tiny number of Unicode aliases" do
    o = Object.new
    assert o.singleton_class == o.ⓒ
    assert o.ç == o.class
    assert 10 == Σ(1..4)
    assert 24 == Π(1..4)
    2.must_equal 4.sqrt
    3.√( 8 ).must_equal 2
    ɱ = Module.new
    ɱ.ç_variable_set :@@meaning, 42
    assert ɱ.class_variable_get( :@@meaning ) == 42
    assert ɱ.ç_variable_get( :@@meaning ) == 42
    assert ɱ.ç_variable_defined?( :@@meaning )
    ɱ.remove_ç_variable :@@meaning
    assert ! ɱ.ç_variable_defined?( :@@meaning )
    ɱ.module_exec { ★ Comparable }
    assert ɱ < Comparable
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
y_support-2.5.3 test/unicode_test.rb
y_support-2.5.2 test/unicode_test.rb
y_support-2.5.1 test/unicode_test.rb
y_support-2.4.6 test/unicode_test.rb