Sha256: 72f9bb5215a0244d33980b147ab9b4e7a07c8e72020a73188dcb2b54aecf0146

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 Bytes

Contents

require 'test/unit'

require 'parse/expand_grammar'
include Parse::Grammar

class UT_Parse_expand_grammar < Test::Unit::TestCase
  def test_01_internal_nonterm_num
    g = Grammar.new
    assert_equal(1, g.next_free_internal_nonterminal_num)
    assert_equal(2, g.next_free_internal_nonterminal_num)
    assert_equal(3, g.next_free_internal_nonterminal_num)
  end

  def test_02_create_fresh_nonterminal
    g = Grammar.new
    nt = g.create_fresh_nonterminal
    assert_kind_of(NonTerminal, nt)

    # The name should start with the prefix
    re = Regexp.new("^" + Grammar::InternalNontermNamePrefix)
    assert_match(re, nt.name.to_s)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rockit-0.7.1 tests/unit/parse/utest_expand_grammar.rb