Sha256: c97bec9dfb02ba8a02287ed07ba86dd9dd6aef08129814c1ff032e86544ff787

Contents?: true

Size: 543 Bytes

Versions: 15

Compression:

Stored size: 543 Bytes

Contents

require "#{File.dirname(__FILE__)}/../lib/gitrb"
require 'pp'

describe Gitrb::Trie do

  it "should add children" do
    trie = Gitrb::Trie.new
    0.upto(100) do |i|
      trie.insert('a' * i, i)
    end
    trie.find('').key.should == ''
    trie.find('').value.should == 0
    1.upto(100) do |i|
      trie.find('a' * i).key.should == 'a'
      trie.find('a' * i).value.should == i
    end
  end

  it "should split node" do
    trie = Gitrb::Trie.new
    trie.insert("abc", 1)
    trie.insert("ab", 2)
    trie.insert("ac", 3)
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gitrb-0.1.5 test/trie_spec.rb
gitrb-0.1.4 test/trie_spec.rb
gitrb-0.1.3 test/trie_spec.rb
gitrb-0.1.2 test/trie_spec.rb
gitrb-0.1.1 test/trie_spec.rb
gitrb-0.1.0 test/trie_spec.rb
gitrb-0.0.9 test/trie_spec.rb
gitrb-0.0.8 test/trie_spec.rb
gitrb-0.0.7 test/trie_spec.rb
gitrb-0.0.6 test/trie_spec.rb
gitrb-0.0.5 test/trie_spec.rb
gitrb-0.0.4 test/trie_spec.rb
gitrb-0.0.3 test/trie_spec.rb
gitrb-0.0.2 test/trie_spec.rb
gitrb-0.0.1 test/trie_spec.rb