Sha256: cf8494d605aa986f0cccf9d84b35061e1fbfa0405a5081fbdbcfbd0c9b31d4ce

Contents?: true

Size: 584 Bytes

Versions: 6

Compression:

Stored size: 584 Bytes

Contents

require(File.expand_path(File.dirname(__FILE__) + '/helpers_tests.rb'))

class StatsampleResampleTestCase < Minitest::Test
  def initialize(*args)
    super
  end

  def test_basic
    r = Statsample::Resample.generate(20, 1, 10)
    assert_equal(20, r.size)
    assert(r.min >= 1)
    assert(r.max <= 10)
  end

  def test_repeat_and_save
    r = Statsample::Resample.repeat_and_save(400) {
      Statsample::Resample.generate(20, 1, 10).count(1)
    }
    assert_equal(400, r.size)
    v = Daru::Vector.new(r)
    a = v.count { |x|  x > 3 }
    assert(a >= 30 && a <= 70)
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
statsample-ekatena-2.0.2.1 test/test_resample.rb
statsample-ekatena-2.0.2 test/test_resample.rb
statsample-2.1.0 test/test_resample.rb
statsample-2.0.2 test/test_resample.rb
statsample-2.0.1 test/test_resample.rb
statsample-2.0.0 test/test_resample.rb