Methods
S
T
Instance Public methods
setup()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 7
def setup
  @parser = Journey::Parser.new
end
test_alphabet()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 55
def test_alphabet
  table  = tt 'a|:a'
  assert_equal [/[^\.\/\?]+/, 'a'], table.alphabet

  table  = tt 'a|a'
  assert_equal ['a'], table.alphabet
end
test_eclosure()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 11
def test_eclosure
  table = tt '/'
  assert_equal [0], table.eclosure(0)

  table = tt ':a|:b'
  assert_equal 3, table.eclosure(0).length

  table = tt '(:a|:b)'
  assert_equal 5, table.eclosure(0).length
  assert_equal 5, table.eclosure([0]).length
end
test_following_states_group()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 30
def test_following_states_group
  table  = tt 'a|b'
  states = table.eclosure 0

  assert_equal 1, table.following_states(states, 'a').length
  assert_equal 1, table.following_states(states, 'b').length
end
test_following_states_multi()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 38
def test_following_states_multi
  table  = tt 'a|a'
  states = table.eclosure 0

  assert_equal 2, table.following_states(states, 'a').length
  assert_equal 0, table.following_states(states, 'b').length
end
test_following_states_one()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 23
def test_following_states_one
  table = tt '/'

  assert_equal [1], table.following_states(0, '/')
  assert_equal [1], table.following_states([0], '/')
end
test_following_states_regexp()
# File actionpack/test/journey/nfa/transition_table_test.rb, line 46
def test_following_states_regexp
  table  = tt 'a|:a'
  states = table.eclosure 0

  assert_equal 1, table.following_states(states, 'a').length
  assert_equal 1, table.following_states(states, /[^\.\/\?]+/).length
  assert_equal 0, table.following_states(states, 'b').length
end