fedora-migrator /vendor/gems/facets-2.4.5/test/core/array/test_pad.rb

Language Ruby Lines 34
MD5 Hash e92ccf5cfb5b619c1277086e145d2058 Estimated Cost $585 (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
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
Back to Top