Skip to content

Commit

Permalink
Separating out debug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Oct 24, 2010
1 parent a9d07df commit db38e09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
23 changes: 23 additions & 0 deletions test/debug_test.rb
@@ -0,0 +1,23 @@
require File.expand_path('../helper', __FILE__)

# This file tests functionality that is only present when debugging is enabled.

class DebugTest < Test::Unit::TestCase

def test_offset
match = Words.parse('one two')
assert(match)
assert_equal(0, match.offset)

words = match.find(:word)
assert(match)
assert_equal(2, words.length)

assert_equal('one', words[0])
assert_equal(0, words[0].offset)

assert_equal('two', words[1])
assert_equal(4, words[1].offset)
end

end
16 changes: 0 additions & 16 deletions test/match_test.rb
Expand Up @@ -53,20 +53,4 @@ def test_matches_deep
assert_equal(15, match.find(:alpha).length)
end

def test_offset
match = Words.parse('one two')
assert(match)
assert_equal(0, match.offset)

words = match.find(:word)
assert(match)
assert_equal(2, words.length)

assert_equal('one', words[0])
assert_equal(0, words[0].offset)

assert_equal('two', words[1])
assert_equal(4, words[1].offset)
end

end

0 comments on commit db38e09

Please sign in to comment.