Sha256: 8dfad97c8f3b22bf07210ba47a29f39b3cbcf9010c53bba03b37675f03377891

Contents?: true

Size: 546 Bytes

Versions: 16

Compression:

Stored size: 546 Bytes

Contents

require 'facets/array/pad'
require 'test/unit'

class TC_Array_Prime < Test::Unit::TestCase

  def test_pad
    r = [0,1,2,3].pad(7,"x")
    x = [0,1,2,3,"x","x","x"]
    assert_equal(x,r)
  end

  def test_pad!
    a = [0,1,2,3]
    r = a.pad!(6,"y")
    x = [0,1,2,3,"y","y"]
    assert_equal(x,a)
  end

  def test_pad_negative
    r = [0,1,2,3].pad(-7,"n")
    x = ["n","n","n",0,1,2,3]
    assert_equal(x,r)
  end

  def test_pad_negative!
    a = [0,1,2,3]
    r = a.pad!(-6,"q")
    x = ["q","q",0,1,2,3]
    assert_equal(x,a)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/array/test_pad.rb
facets-2.8.3 test/core/array/test_pad.rb
facets-2.8.2 test/core/array/test_pad.rb
facets-2.8.1 test/core/array/test_pad.rb
facets-2.8.0 test/core/array/test_pad.rb
facets-2.7.0 test/core/array/test_pad.rb
facets-2.6.0 test/core/array/test_pad.rb
facets-2.4.0 test/array/test_pad.rb
facets-2.4.1 test/array/test_pad.rb
facets-2.4.2 test/core/array/test_pad.rb
facets-2.4.4 test/core/array/test_pad.rb
facets-2.4.3 test/core/array/test_pad.rb
facets-2.5.0 test/core/array/test_pad.rb
facets-2.4.5 test/core/array/test_pad.rb
facets-2.5.1 test/core/array/test_pad.rb
facets-2.5.2 test/core/array/test_pad.rb