<commit_before>
#
# testing ruote
#
# Sat Jan 24 22:40:35 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')


class EftSequenceTest < Test::Unit::TestCase
  include FunctionalBase

  def test_empty_sequence

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
      end
    end

    #noisy

    assert_trace('', pdef)
  end

  def test_a_b_sequence

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        echo 'a'
        echo 'b'
      end
    end

    #noisy

    assert_trace("a\nb", pdef)
  end

  def test_alice_bob_sequence

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        participant :ref => 'alice'
        participant :ref => 'bob'
      end
    end

    @engine.register_participant '.+' do |workitem|
      @tracer << workitem.participant_name + "\n"
    end

    #noisy

    assert_trace("alice\nbob", pdef)
  end
end

<commit_msg>eft_2: context instead of @context<commit_after>
#
# testing ruote
#
# Sat Jan 24 22:40:35 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')


class EftSequenceTest < Test::Unit::TestCase
  include FunctionalBase

  def test_empty_sequence

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
      end
    end

    #noisy

    assert_trace('', pdef)
  end

  def test_a_b_sequence

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        echo 'a'
        echo 'b'
      end
    end

    #noisy

    assert_trace("a\nb", pdef)
  end

  def test_alice_bob_sequence

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        participant :ref => 'alice'
        participant :ref => 'bob'
      end
    end

    @engine.register_participant '.+' do |workitem|
      context.tracer << workitem.participant_name + "\n"
    end

    #noisy

    assert_trace("alice\nbob", pdef)
  end
end


{'fraction_non_alphanumeric': 0.101159114857745, 'fraction_numerical': 0.013171759747102213, 'mean_word_length': 2.4908088235294117, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '952843', 'n_tokens_mistral': 694, 'n_tokens_neox': 638, 'n_words': 164}