Sha256: 7b09c00815738ac8d272f8aad574edb90e98561a61299c1dc1cbc4d5b7c7d8b7

Contents?: true

Size: 534 Bytes

Versions: 5

Compression:

Stored size: 534 Bytes

Contents

require File.expand_path('../helper', __FILE__)

class LabelTest < Test::Unit::TestCase

  def test_terminal?
    rule = Label.new
    assert_equal(false, rule.terminal?)
  end

  def test_match
    rule = Label.new('label', 'a')

    match = rule.match(input('a'))
    assert(match)
    assert_equal(:label, match.name)
  end

  def test_to_s
    rule = Label.new('label', 'a')
    assert_equal('label:"a"', rule.to_s)

    rule = Label.new('label', Sequence.new(%w< a b >))
    assert_equal('label:("a" "b")', rule.to_s)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
citrus-1.7.0 test/label_test.rb
citrus-1.6.0 test/label_test.rb
citrus-1.5.2 test/label_test.rb
citrus-1.5.1 test/label_test.rb
citrus-1.5.0 test/label_test.rb