Sha256: d652ad34881e52de4a7f11b35da9eebf5e68630bb7f727db31a0be6f2e03fff5

Contents?: true

Size: 772 Bytes

Versions: 17

Compression:

Stored size: 772 Bytes

Contents

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
facets-2.9.2 work/defunct/test/test_succ.rb
facets-2.8.4 test/more/test_succ.rb
facets-2.8.3 test/more/test_succ.rb
facets-2.8.2 test/more/test_succ.rb
facets-2.8.1 test/more/test_succ.rb
facets-2.8.0 test/more/test_succ.rb
facets-2.7.0 test/more/test_succ.rb
facets-2.6.0 test/more/test_succ.rb
facets-2.4.0 test/test_succ.rb
facets-2.4.1 test/test_succ.rb
facets-2.4.2 test/more/test_succ.rb
facets-2.4.4 test/more/test_succ.rb
facets-2.4.3 test/more/test_succ.rb
facets-2.5.0 test/more/test_succ.rb
facets-2.4.5 test/more/test_succ.rb
facets-2.5.1 test/more/test_succ.rb
facets-2.5.2 test/more/test_succ.rb