Sha256: 8219ae4d3e74ca3ce53d18f54f6cf33a0b59377202b81b02fb3a651f42a663ec

Contents?: true

Size: 439 Bytes

Versions: 16

Compression:

Stored size: 439 Bytes

Contents

require 'facets/array/rotate'
require 'test/unit'

class TC_Array_Rotate < Test::Unit::TestCase

  # rotate

  def test_rotate
    a = [1,2,3]
    assert_equal( [3,1,2], a.rotate, 'clockwise' )
    assert_equal( [2,3,1], a.rotate(-1), 'counter-clockwise' )
  end

  def test_rotate!
    a = [1,2,3]
    a.rotate!
    assert_equal( [3,1,2], a, 'clockwise' )
    a.rotate!(-1)
    assert_equal( [1,2,3], a, 'counter-clockwise' )
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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