Sha256: 3c8ec759a3d23b09a40a3aeecdae4c224608c66e6963d163eb7c27880989e0bf

Contents?: true

Size: 1.79 KB

Versions: 259

Compression:

Stored size: 1.79 KB

Contents

#require 'runtime/interval_skip_list/spec_helper'
#
#MAX_INTERVAL = 100000
#
#describe IntervalSkipList do
#  describe "#next_node_height" do
#    attr_reader :list
#
#    before do
#      @list = IntervalSkipList.new
#    end
#
#    it "returns a number between 1 and the max_height of the list" do
#      height = list.next_node_height
#      height.should be <= list.max_height
#      height.should be > 0
#    end
#  end
#
#  describe "a list with 1000 random intervals" do
#    attr_reader :list, :inserted_ranges
#
#    before do
#      @list = IntervalSkipList.new
#      @inserted_ranges = []
#
#      0.upto(10) do |i|
#        first, last = [rand(MAX_INTERVAL), rand(MAX_INTERVAL)].sort
#        range = first..last
#        list.insert(range, i)
#        inserted_ranges.push(range)
#      end
#    end
#
#    it "functions correctly for stabbing queries" do
#      10000.times do
#        n = rand(MAX_INTERVAL)
#        ranges = list.containing(n).sort
#
#        expected_ranges = []
#        inserted_ranges.each_with_index do |range,i|
#          expected_ranges.push(i) if n > range.first && n < range.last
#        end
#        expected_ranges.sort!
#        unless ranges == expected_ranges
#          puts "N = #{n}"
#          puts "Expected: " + expected_ranges.inspect
#          puts "Actual:   " + ranges.inspect
#          expected_ranges.size.should be <= ranges.size
#          puts "Missing containers: #{(expected_ranges.map {|o| o.object_id} - ranges.map {|o| o.object_id}).inspect}"
#          puts "Unexpected containers: #{(ranges.map {|o| o.object_id} - expected_ranges.map {|o| o.object_id}).inspect}"
#          puts "Inserted Ranges: #{inserted_ranges.inspect}"
#          puts "Expected Ranges: #{expected_ranges.map {|i| inserted_ranges[i]}.inspect}"
#        end
#      end
#    end
#  end
#end

Version data entries

259 entries across 214 versions & 32 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/spec/runtime/interval_skip_list/interval_skip_list_spec.rb