Sha256: 35cd498f3fd9f379a457239da2461717e63d411ddb0cb9193f0c6e9fd9beb77d

Contents?: true

Size: 1.21 KB

Versions: 13

Compression:

Stored size: 1.21 KB

Contents

#
# testing ruote
#
# Thu May 21 15:29:48 JST 2009
#

require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')

require 'ruote/engine/process_status'


class TreeTest < Test::Unit::TestCase

  def test_decompose_tree

    assert_equal(
      {"0"=>["define", {"name"=>"nada"}],
       "0_0"=>["sequence", {}],
       "0_0_0"=>["alpha", {}],
       "0_0_1"=>["bravo", {}]},
      Ruote.decompose_tree(
        ["define", {"name"=>"nada"}, [
          ["sequence", {}, [["alpha", {}, []], ["bravo", {}, []]]]
        ]]))
  end

  def test_decompose_sub_tree

    assert_equal(
      {"0_1"=>["define", {"name"=>"nada"}],
       "0_1_0"=>["sequence", {}],
       "0_1_0_0"=>["alpha", {}],
       "0_1_0_1"=>["bravo", {}]},
      Ruote.decompose_tree(
        ["define", {"name"=>"nada"}, [
          ["sequence", {}, [["alpha", {}, []], ["bravo", {}, []]]]
        ]], '0_1'))
  end

  def test_recompose_tree

    assert_equal(
      ["define", {"name"=>"nada"}, [
        ["sequence", {}, [["alpha", {}, []], ["bravo", {}, []]]]
      ]],
      Ruote.recompose_tree(
        {"0"=>["define", {"name"=>"nada"}],
         "0_0"=>["sequence", {}],
         "0_0_0"=>["alpha", {}],
         "0_0_1"=>["bravo", {}]}))
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/unit/ut_5_tree.rb
ruote-2.2.0 test/unit/ut_5_tree.rb
ruote-2.1.11 test/unit/ut_5_tree.rb
ruote-2.1.10 test/unit/ut_5_tree.rb
ruote-2.1.9 test/unit/ut_5_tree.rb
ruote-2.1.8 test/unit/ut_5_tree.rb
ruote-2.1.7 test/unit/ut_5_tree.rb
ruote-2.1.6 test/unit/ut_5_tree.rb
ruote-2.1.5 test/unit/ut_5_tree.rb
ruote-2.1.4 test/unit/ut_5_tree.rb
ruote-2.1.3 test/unit/ut_5_tree.rb
ruote-2.1.2 test/unit/ut_5_tree.rb
ruote-2.1.1 test/unit/ut_5_tree.rb