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

Language Ruby Lines 36
MD5 Hash 28901281451a16f8578e44a60467cf60 Estimated Cost $633 (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
require 'facets/succ.rb'
require 'test/unit'

class TestStringSucc < Test::Unit::TestCase

  def test_succ
    assert_equal( "b", "a".succ )
    assert_equal( "b", "a".succ(1) )
    assert_equal( "c", "a".succ(2) )
    assert_equal( "d", "a".succ(3) )
  end

end

class TestNumericSucc < Test::Unit::TestCase

  def test_pred
    assert_equal(  3,  4.pred )
    assert_equal( -3, -2.pred )
    assert_equal(  2,  4.pred(2) )
    assert_equal( -4, -2.pred(2) )
    assert_equal(  6,  4.pred(-2) )
    assert_equal(  0, -2.pred(-2) )
  end

  def test_succ
    assert_equal(  5,  4.succ )
    assert_equal( -1, -2.succ )
    assert_equal(  6,  4.succ(2) )
    assert_equal(  0, -2.succ(2) )
    assert_equal(  2,  4.succ(-2) )
    assert_equal( -4, -2.succ(-2) )
  end

end
Back to Top