znmud-0.0.1/benchmark/
znmud-0.0.1/cmd/
znmud-0.0.1/cmd/emotes/
znmud-0.0.1/cmd/objects/
znmud-0.0.1/cmd/tiny/
znmud-0.0.1/doc/
znmud-0.0.1/farts/
znmud-0.0.1/lib/
znmud-0.0.1/lib/combat/
znmud-0.0.1/lib/core/bodytypes/
znmud-0.0.1/lib/engine/
znmud-0.0.1/lib/farts/
znmud-0.0.1/logs/
# Code Generated by ZenTest v. 2.3.0
#                 classname: asrt / meth =  ratio%
#               TernaryTrie:   11 /    5 = 220.00%

unless defined? $ZENTEST and $ZENTEST
require 'test/unit'
require 'utility/ternarytrie'
end

class TestTernaryTrie < Test::Unit::TestCase
  def setup
    @t = TernaryTrie.new
  end

  def test_find
    assert(true, @t.insert("two", 2))
    assert(true, @t.insert("three", 3))
    assert_equal([3,2], @t.find("t"))
    assert_equal([2], @t.find("tw"))
    assert_equal([], @t.find("o"))
  end

  def test_find_exact
    assert(true, @t.insert("one", 1))
    assert_equal(1, @t.find_exact("one"))
    assert_equal(nil, @t.find_exact("two"))
  end

  def test_insert
    assert(true, @t.insert("one", 1))
    assert_equal(1, @t.find_exact("one"))
  end

  def test_to_hash
    assert(true, @t.insert("one", 1))
    assert(true, @t.insert("two", 2))
    assert(true, @t.insert("three", 3))
    assert_equal({"one" => 1, "two" => 2, "three" => 3},
      @t.to_hash)
  end
end