Permalink
Browse files

Sort the alphabet so the order is consistent

  • Loading branch information...
1 parent 34fcd06 commit 13bb2be4f6497db2f494cf600e6ae1a416a17705 @evanphx evanphx committed Dec 20, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/journey/nfa/transition_table.rb
  2. +1 −1 test/nfa/test_transition_table.rb
@@ -109,7 +109,7 @@ def move t, a
end
def alphabet
- inverted.values.map(&:keys).flatten.compact.uniq
+ inverted.values.map(&:keys).flatten.compact.uniq.sort_by { |x| x.to_s }
end
###
@@ -53,7 +53,7 @@ def test_following_states_regexp
def test_alphabet
table = tt 'a|:a'
- assert_equal ['a', /[^\.\/\?]+/], table.alphabet
+ assert_equal [/[^\.\/\?]+/, 'a'], table.alphabet
table = tt 'a|a'
assert_equal ['a'], table.alphabet

0 comments on commit 13bb2be

Please sign in to comment.