citrus 1.8.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
-
3
- class ExpressionTest < Test::Unit::TestCase
4
-
5
- def test_terminal?
6
- rule = Expression.new
7
- assert(rule.terminal?)
8
- end
9
-
10
- def test_match
11
- rule = Expression.new(/\d+/)
12
- match = rule.match(input('123 456'))
13
- assert(match)
14
- assert_equal('123', match)
15
- assert_equal(3, match.length)
16
- end
17
-
18
- def test_match_failure
19
- rule = Expression.new(/\d+/)
20
- match = rule.match(input(' 456'))
21
- assert_equal(nil, match)
22
- end
23
-
24
- def test_to_s
25
- rule = Expression.new(/\d+/)
26
- assert_equal('/\\d+/', rule.to_s)
27
- end
28
-
29
- end
@@ -1,37 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
-
3
- class FixedWidthTest < Test::Unit::TestCase
4
-
5
- def test_terminal?
6
- rule = FixedWidth.new
7
- assert(rule.terminal?)
8
- end
9
-
10
- def test_match
11
- rule = FixedWidth.new('abc')
12
- match = rule.match(input('abc'))
13
- assert(match)
14
- assert_equal('abc', match)
15
- assert_equal(3, match.length)
16
- end
17
-
18
- def test_match_short
19
- rule = FixedWidth.new('abc')
20
- match = rule.match(input('ab'))
21
- assert_equal(nil, match)
22
- end
23
-
24
- def test_match_long
25
- rule = FixedWidth.new('abc')
26
- match = rule.match(input('abcd'))
27
- assert(match)
28
- assert_equal('abc', match)
29
- assert_equal(3, match.length)
30
- end
31
-
32
- def test_to_s
33
- rule = FixedWidth.new('abc')
34
- assert_equal('"abc"', rule.to_s)
35
- end
36
-
37
- end