Sha256: 6e31a11eab8aeb9535ace798b0dfeb370bf4214e3b8c687a59f5957e07552de7

Contents?: true

Size: 582 Bytes

Versions: 16

Compression:

Stored size: 582 Bytes

Contents

require 'facets/array/delete'
require 'test/unit'

class TC_Array_Delete < Test::Unit::TestCase

  # delete

  def test_delete_unless
    a = [1,2,3]
    a.delete_unless{ |e| e == 2 }
    assert_equal( [2], a )
  end

  def test_delete_values
    a = [1,2,3,4]
    assert_equal( [1,2], a.delete_values(1,2) )
    assert_equal( [3,4], a )
  end

  def test_delete_values_at
    a = [1,2,3,4]
    assert_equal( [2,3], a.delete_values_at(1,2) )
    assert_equal( [1,4], a )
    a = [1,2,3,4]
    assert_equal( [1,2,3], a.delete_values_at(0..2) )
    assert_equal( [4], a )
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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