Sha256: a30f8e35c00f385a708b390aa333b8bb814133b7e0802afcbd69d20ecfa862ea

Contents?: true

Size: 874 Bytes

Versions: 20

Compression:

Stored size: 874 Bytes

Contents

# Test facets/tuple.rb

require 'facets/tuple.rb'
require 'test/unit'

class TC_Tuple < Test::Unit::TestCase

  def test_01
    t1 = Tuple[1,2,3]
    t2 = Tuple[2,4,5]
    assert( t1 < t2 )
    assert( t2 > t1 )
  end

  def test_02
    t1 = Tuple[1,2,3]
    a1 = t1.to_a
    assert( Array === a1 )
  end

  def test_03
    t1 = Tuple[1,2,3]
    t2 = Tuple[1,2,3]
    assert( t1.object_id === t2.object_id )
  end

  def test_04
    t1 = Tuple[1,2,3]
    t1 = t1 << 4
    assert( Tuple === t1 )
    t2 = Tuple[1,2,3,4]
    assert( t1.object_id == t2.object_id )
  end

  def test_05
    t1 = "1.2.3".to_t
    assert( Tuple === t1 )
    t2 = Tuple[1,2,3]
    assert( t1.object_id == t2.object_id )
  end

  def test_06
    t1 = "1.2.3a".to_t
    assert( Tuple === t1 )
    t2 = Tuple[1,2,'3a']
    assert_equal( t2, t1 )
    assert( t2.object_id == t1.object_id )
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
facets-2.8.4 test/more/test_tuple.rb
facets-2.8.3 test/more/test_tuple.rb
facets-2.8.2 test/more/test_tuple.rb
facets-2.8.1 test/more/test_tuple.rb
facets-2.8.0 test/more/test_tuple.rb
facets-2.7.0 test/more/test_tuple.rb
facets-2.6.0 test/more/test_tuple.rb
facets-2.1.3 test/unit/test_tuple.rb
facets-2.2.0 test/unit/test_tuple.rb
facets-2.2.1 test/unit/test_tuple.rb
facets-2.3.0 test/class/test_tuple.rb
facets-2.4.0 test/test_tuple.rb
facets-2.4.1 test/test_tuple.rb
facets-2.4.3 test/more/test_tuple.rb
facets-2.4.2 test/more/test_tuple.rb
facets-2.4.4 test/more/test_tuple.rb
facets-2.5.1 test/more/test_tuple.rb
facets-2.5.0 test/more/test_tuple.rb
facets-2.4.5 test/more/test_tuple.rb
facets-2.5.2 test/more/test_tuple.rb