Sha256: d7df0fb81f5fe031c4a7d8eeaf40a17bcd065f1a5cf793152e4efafb30daf137

Contents?: true

Size: 576 Bytes

Versions: 3

Compression:

Stored size: 576 Bytes

Contents

# Test for facets/array/pad.rb

require 'facets/array/pad.rb'

require 'test/unit'

class TestArray < 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

3 entries across 3 versions & 1 rubygems

Version Path
facets-2.2.0 test/unit/array/test_pad.rb
facets-2.3.0 test/core/array/test_pad.rb
facets-2.2.1 test/unit/array/test_pad.rb