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
depengine-0.0.20 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.19 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.19 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
treetop-1.5.3 spec/runtime/interval_skip_list/interval_skip_list_spec.rb
treetop-1.5.1 spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.18 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.18 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.17 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.17 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
treetop-1.4.15 spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.16 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.16 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.15 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.15 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.14 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.14 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.13 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
depengine-0.0.13 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
challah-1.0.0 vendor/bundle/gems/treetop-1.4.14/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
classiccms-0.7.2 vendor/bundle/gems/treetop-1.4.10/spec/runtime/interval_skip_list/interval_skip_list_spec.rb