Sha256: 64be6d72863fab37f858221a29e6404883233c252ca8aed2741a76fd39c501e8

Contents?: true

Size: 1.01 KB

Versions: 163

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby
gem 'minitest', '>= 5.0.0'
require 'minitest/autorun'
require_relative 'flatten_array'

class FlattenArrayTest < Minitest::Test
  def test_two_level_nesting
    fa = FlattenArray.flatten([1, [2, 3, 4, 5, 6, 7], 8])
    assert_equal [1, 2, 3, 4, 5, 6, 7, 8], fa
  end

  def test_five_level_nesting
    skip
    fa = FlattenArray.flatten([0, 2, [[2, 3], 8, 100, 4, [[[50]]]], -2])
    assert_equal [0, 2, 2, 3, 8, 100, 4, 50, -2], fa
  end

  def test_six_level_nesting
    skip
    fa = FlattenArray.flatten([1, [2, [[3]], [4, [[5]]], 6, 7], 8])
    assert_equal [1, 2, 3, 4, 5, 6, 7, 8], fa
  end

  def test_six_level_nesting_with_nil_values
    skip
    fa = FlattenArray.flatten([0, 2, [[2, 3], 8, [[100]], nil, [[nil]]], -2])
    assert_equal [0, 2, 2, 3, 8, 100, -2], fa
  end

  def test_all_values_are_nil
    skip
    fa = FlattenArray.flatten([nil, [[[nil]]], nil, [[nil, nil], nil], nil])
    assert_equal [], fa
  end

  def test_bookkeeping
    skip
    assert_equal 1, FlattenArray::VERSION
  end
end

Version data entries

163 entries across 163 versions & 1 rubygems

Version Path
trackler-2.1.0.7 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.6 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.5 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.4 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.3 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.2 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.1 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.1.0.0 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.55 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.54 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.53 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.52 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.51 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.50 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.49 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.48 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.47 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.46 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.45 tracks/ruby/exercises/flatten-array/flatten_array_test.rb
trackler-2.0.8.44 tracks/ruby/exercises/flatten-array/flatten_array_test.rb