fedora-migrator /vendor/gems/facets-2.4.5/test/more/test_tuple.rb

Language Ruby Lines 51
MD5 Hash 984d0226f4a1079843e5012f946488b2 Estimated Cost $920 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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
Back to Top