regexp_parser 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/lib/regexp_parser/syntax/ruby/1.9.1.rb +1 -1
- data/lib/regexp_parser/syntax/tokens/escape.rb +2 -0
- data/lib/regexp_parser/version.rb +1 -1
- data/test/expression/test_base.rb +32 -34
- data/test/expression/test_clone.rb +49 -47
- data/test/expression/test_conditionals.rb +40 -40
- data/test/expression/test_free_space.rb +4 -2
- data/test/expression/test_set.rb +16 -16
- data/test/expression/test_strfregexp.rb +74 -74
- data/test/expression/test_subexpression.rb +2 -2
- data/test/expression/test_tests.rb +57 -57
- data/test/expression/test_to_h.rb +11 -6
- data/test/expression/test_to_s.rb +22 -15
- data/test/expression/test_traverse.rb +26 -29
- data/test/lexer/test_all.rb +9 -7
- data/test/lexer/test_conditionals.rb +35 -11
- data/test/lexer/test_keep.rb +6 -6
- data/test/lexer/test_literals.rb +20 -10
- data/test/lexer/test_nesting.rb +14 -7
- data/test/lexer/test_refcalls.rb +12 -5
- data/test/parser/test_all.rb +15 -13
- data/test/parser/test_alternation.rb +29 -26
- data/test/parser/test_anchors.rb +7 -8
- data/test/parser/test_conditionals.rb +43 -41
- data/test/parser/test_escapes.rb +18 -16
- data/test/parser/test_free_space.rb +33 -33
- data/test/parser/test_groups.rb +46 -46
- data/test/parser/test_keep.rb +4 -4
- data/test/parser/test_properties.rb +18 -16
- data/test/parser/test_quantifiers.rb +184 -163
- data/test/parser/test_refcalls.rb +48 -32
- data/test/parser/test_sets.rb +102 -88
- data/test/parser/test_types.rb +7 -8
- data/test/scanner/test_all.rb +6 -4
- data/test/scanner/test_anchors.rb +8 -5
- data/test/scanner/test_conditionals.rb +38 -20
- data/test/scanner/test_escapes.rb +8 -6
- data/test/scanner/test_free_space.rb +89 -65
- data/test/scanner/test_groups.rb +27 -32
- data/test/scanner/test_keep.rb +24 -22
- data/test/scanner/test_literals.rb +11 -7
- data/test/scanner/test_meta.rb +11 -7
- data/test/scanner/test_properties.rb +16 -14
- data/test/scanner/test_quantifiers.rb +8 -9
- data/test/scanner/test_refcalls.rb +26 -23
- data/test/scanner/test_scripts.rb +11 -10
- data/test/scanner/test_sets.rb +8 -5
- data/test/scanner/test_types.rb +17 -15
- data/test/scanner/test_unicode_blocks.rb +11 -10
- data/test/syntax/ruby/test_1.8.rb +4 -8
- data/test/syntax/ruby/test_1.9.1.rb +1 -7
- data/test/syntax/ruby/test_1.9.3.rb +3 -7
- data/test/syntax/ruby/test_2.0.0.rb +1 -7
- data/test/syntax/ruby/test_2.2.0.rb +1 -7
- data/test/token/test_token.rb +29 -31
- metadata +3 -3
@@ -22,13 +22,16 @@ class ScannerAnchors < Test::Unit::TestCase
|
|
22
22
|
"a\\\\Bc" => [1, :escape, :backslash, '\\\\', 1, 3],
|
23
23
|
}
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
define_method "test_scanner_#{test[1]}_#{test[2]}_#{count+=1}" do
|
28
|
-
|
25
|
+
tests.each_with_index do |(pattern, (index, type, token, text, ts, te)), count|
|
26
|
+
define_method "test_scanner_#{type}_#{token}_#{count}" do
|
29
27
|
tokens = RS.scan(pattern)
|
30
|
-
|
28
|
+
result = tokens[index]
|
31
29
|
|
30
|
+
assert_equal type, result[0]
|
31
|
+
assert_equal token, result[1]
|
32
|
+
assert_equal text, result[2]
|
33
|
+
assert_equal ts, result[3]
|
34
|
+
assert_equal te, result[4]
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
@@ -22,14 +22,16 @@ class ScannerConditionals < Test::Unit::TestCase
|
|
22
22
|
/(?'N'A)(?('N')T|F)/ => [5, :conditional, :condition, "'N'", 10, 13],
|
23
23
|
}
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
define_method "test_scan_#{test[1]}_#{test[2]}_#{count+=1}" do
|
28
|
-
|
25
|
+
tests.each_with_index do |(pattern, (index, type, token, text, ts, te)), count|
|
26
|
+
define_method "test_scanner_#{type}_#{token}_#{count}" do
|
29
27
|
tokens = RS.scan(pattern)
|
30
|
-
|
31
|
-
assert_equal( test[1,5], token )
|
28
|
+
result = tokens[index]
|
32
29
|
|
30
|
+
assert_equal type, result[0]
|
31
|
+
assert_equal token, result[1]
|
32
|
+
assert_equal text, result[2]
|
33
|
+
assert_equal ts, result[3]
|
34
|
+
assert_equal te, result[4]
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
@@ -80,8 +82,14 @@ class ScannerConditionals < Test::Unit::TestCase
|
|
80
82
|
[40, :conditional, :close, ')', 45, 46],
|
81
83
|
[41, :conditional, :close, ')', 46, 47],
|
82
84
|
[42, :conditional, :close, ')', 47, 48]
|
83
|
-
].each do |
|
84
|
-
|
85
|
+
].each do |index, type, token, text, ts, te|
|
86
|
+
result = tokens[index]
|
87
|
+
|
88
|
+
assert_equal type, result[0]
|
89
|
+
assert_equal token, result[1]
|
90
|
+
assert_equal text, result[2]
|
91
|
+
assert_equal ts, result[3]
|
92
|
+
assert_equal te, result[4]
|
85
93
|
end
|
86
94
|
end
|
87
95
|
|
@@ -139,8 +147,14 @@ class ScannerConditionals < Test::Unit::TestCase
|
|
139
147
|
[47, :conditional, :close, ')', 50, 51],
|
140
148
|
[48, :group, :close, ')', 51, 52],
|
141
149
|
[49, :group, :close, ')', 52, 53]
|
142
|
-
].each do |
|
143
|
-
|
150
|
+
].each do |index, type, token, text, ts, te|
|
151
|
+
result = tokens[index]
|
152
|
+
|
153
|
+
assert_equal type, result[0]
|
154
|
+
assert_equal token, result[1]
|
155
|
+
assert_equal text, result[2]
|
156
|
+
assert_equal ts, result[3]
|
157
|
+
assert_equal te, result[4]
|
144
158
|
end
|
145
159
|
end
|
146
160
|
|
@@ -148,18 +162,22 @@ class ScannerConditionals < Test::Unit::TestCase
|
|
148
162
|
regexp = /(a)(?(1)(b|c|d)|(e|f|g))(h)(?(2)(i|j|k)|(l|m|n))|o|p/
|
149
163
|
tokens = RS.scan(regexp)
|
150
164
|
|
151
|
-
[9, 11, 17, 19, 32, 34, 40, 42, 46, 48].each do |
|
152
|
-
|
153
|
-
|
154
|
-
assert_equal
|
155
|
-
assert_equal
|
165
|
+
[9, 11, 17, 19, 32, 34, 40, 42, 46, 48].each do |index|
|
166
|
+
result = tokens[index]
|
167
|
+
|
168
|
+
assert_equal :meta, result[0]
|
169
|
+
assert_equal :alternation, result[1]
|
170
|
+
assert_equal '|', result[2]
|
171
|
+
assert_equal 1, result[4] - result[3]
|
156
172
|
end
|
157
173
|
|
158
|
-
[14, 37].each do |
|
159
|
-
|
160
|
-
|
161
|
-
assert_equal
|
162
|
-
assert_equal
|
174
|
+
[14, 37].each do |index|
|
175
|
+
result = tokens[index]
|
176
|
+
|
177
|
+
assert_equal :conditional, result[0]
|
178
|
+
assert_equal :separator, result[1]
|
179
|
+
assert_equal '|', result[2]
|
180
|
+
assert_equal 1, result[4] - result[3]
|
163
181
|
end
|
164
182
|
end
|
165
183
|
|
@@ -38,14 +38,16 @@ class ScannerEscapes < Test::Unit::TestCase
|
|
38
38
|
'ab\\\Kcd' => [1, :escape, :backslash, '\\\\', 2, 4],
|
39
39
|
}
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
define_method "test_scan_#{test[1]}_#{test[2]}_#{count+=1}" do
|
44
|
-
|
41
|
+
tests.each_with_index do |(pattern, (index, type, token, text, ts, te)), count|
|
42
|
+
define_method "test_scanner_#{type}_#{token}_#{count}" do
|
45
43
|
tokens = RS.scan(pattern)
|
46
|
-
|
47
|
-
assert_equal( test[1,5], token )
|
44
|
+
result = tokens.at(index)
|
48
45
|
|
46
|
+
assert_equal type, result[0]
|
47
|
+
assert_equal token, result[1]
|
48
|
+
assert_equal text, result[2]
|
49
|
+
assert_equal ts, result[3]
|
50
|
+
assert_equal te, result[4]
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
@@ -13,21 +13,21 @@ class ScannerFreeSpace < Test::Unit::TestCase
|
|
13
13
|
tokens = RS.scan(regexp)
|
14
14
|
|
15
15
|
0.upto(24) do |i|
|
16
|
-
if i
|
17
|
-
assert_equal
|
18
|
-
assert_equal
|
16
|
+
if i.even?
|
17
|
+
assert_equal :free_space, tokens[i][0]
|
18
|
+
assert_equal :whitespace, tokens[i][1]
|
19
19
|
else
|
20
|
-
|
21
|
-
|
20
|
+
refute_equal :free_space, tokens[i][0]
|
21
|
+
refute_equal :whitespace, tokens[i][1]
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
[0, 2, 10, 14].each do |i|
|
26
|
-
assert_equal
|
26
|
+
assert_equal "\n ", tokens[i][2]
|
27
27
|
end
|
28
28
|
|
29
29
|
[4, 6, 8, 12].each do |i|
|
30
|
-
assert_equal
|
30
|
+
assert_equal ' ', tokens[i][2]
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -42,12 +42,18 @@ class ScannerFreeSpace < Test::Unit::TestCase
|
|
42
42
|
tokens = RS.scan(regexp)
|
43
43
|
|
44
44
|
[
|
45
|
-
[ 5,
|
46
|
-
[11,
|
47
|
-
[17,
|
48
|
-
[29,
|
49
|
-
].each do |index, token|
|
50
|
-
|
45
|
+
[ 5, :free_space, :comment, "# A + comment\n", 11, 25],
|
46
|
+
[11, :free_space, :comment, "# B ? comment\n", 37, 51],
|
47
|
+
[17, :free_space, :comment, "# C {2,3} comment\n", 66, 84],
|
48
|
+
[29, :free_space, :comment, "# D|E comment\n", 100, 114],
|
49
|
+
].each do |index, type, token, text, ts, te|
|
50
|
+
result = tokens[index]
|
51
|
+
|
52
|
+
assert_equal type, result[0]
|
53
|
+
assert_equal token, result[1]
|
54
|
+
assert_equal text, result[2]
|
55
|
+
assert_equal ts, result[3]
|
56
|
+
assert_equal te, result[4]
|
51
57
|
end
|
52
58
|
end
|
53
59
|
|
@@ -57,17 +63,23 @@ class ScannerFreeSpace < Test::Unit::TestCase
|
|
57
63
|
tokens = RS.scan(regexp)
|
58
64
|
|
59
65
|
[
|
60
|
-
[0,
|
61
|
-
[1,
|
62
|
-
[2,
|
63
|
-
[3,
|
64
|
-
[4,
|
65
|
-
[5,
|
66
|
-
[6,
|
67
|
-
[7,
|
68
|
-
[8,
|
69
|
-
].each do |index, token|
|
70
|
-
|
66
|
+
[0, :literal, :literal, 'a b', 0, 3],
|
67
|
+
[1, :group, :options, '(?x:', 3, 7],
|
68
|
+
[2, :literal, :literal, 'c', 7, 8],
|
69
|
+
[3, :free_space, :whitespace, ' ', 8, 9],
|
70
|
+
[4, :literal, :literal, 'd', 9, 10],
|
71
|
+
[5, :free_space, :whitespace, ' ', 10, 11],
|
72
|
+
[6, :literal, :literal, 'e', 11, 12],
|
73
|
+
[7, :group, :close, ')', 12, 13],
|
74
|
+
[8, :literal, :literal, 'f g', 13, 16]
|
75
|
+
].each do |index, type, token, text, ts, te|
|
76
|
+
result = tokens[index]
|
77
|
+
|
78
|
+
assert_equal type, result[0]
|
79
|
+
assert_equal token, result[1]
|
80
|
+
assert_equal text, result[2]
|
81
|
+
assert_equal ts, result[3]
|
82
|
+
assert_equal te, result[4]
|
71
83
|
end
|
72
84
|
end
|
73
85
|
|
@@ -77,21 +89,27 @@ class ScannerFreeSpace < Test::Unit::TestCase
|
|
77
89
|
tokens = RS.scan(regexp)
|
78
90
|
|
79
91
|
[
|
80
|
-
[ 0,
|
81
|
-
[ 1,
|
82
|
-
[ 2,
|
83
|
-
[ 3,
|
84
|
-
[ 4,
|
85
|
-
[ 5,
|
86
|
-
[ 6,
|
87
|
-
[ 7,
|
88
|
-
[ 8,
|
89
|
-
[ 9,
|
90
|
-
[10,
|
91
|
-
[11,
|
92
|
-
[12,
|
93
|
-
].each do |index, token|
|
94
|
-
|
92
|
+
[ 0, :literal, :literal, 'a b', 0, 3],
|
93
|
+
[ 1, :group, :options, '(?x:', 3, 7],
|
94
|
+
[ 2, :literal, :literal, 'c', 7, 8],
|
95
|
+
[ 3, :free_space, :whitespace, ' ', 8, 9],
|
96
|
+
[ 4, :literal, :literal, 'd', 9, 10],
|
97
|
+
[ 5, :group, :options, '(?-x:', 10, 15],
|
98
|
+
[ 6, :literal, :literal, 'e f', 15, 18],
|
99
|
+
[ 7, :group, :close, ')', 18, 19],
|
100
|
+
[ 8, :literal, :literal, 'g', 19, 20],
|
101
|
+
[ 9, :free_space, :whitespace, ' ', 20, 21],
|
102
|
+
[10, :literal, :literal, 'h', 21, 22],
|
103
|
+
[11, :group, :close, ')', 22, 23],
|
104
|
+
[12, :literal, :literal, 'i j', 23, 26]
|
105
|
+
].each do |index, type, token, text, ts, te|
|
106
|
+
result = tokens[index]
|
107
|
+
|
108
|
+
assert_equal type, result[0]
|
109
|
+
assert_equal token, result[1]
|
110
|
+
assert_equal text, result[2]
|
111
|
+
assert_equal ts, result[3]
|
112
|
+
assert_equal te, result[4]
|
95
113
|
end
|
96
114
|
end
|
97
115
|
|
@@ -101,32 +119,38 @@ class ScannerFreeSpace < Test::Unit::TestCase
|
|
101
119
|
tokens = RS.scan(regexp)
|
102
120
|
|
103
121
|
[
|
104
|
-
[ 0,
|
105
|
-
[ 1,
|
106
|
-
[ 2,
|
107
|
-
[ 3,
|
108
|
-
[ 4,
|
109
|
-
[ 5,
|
110
|
-
[ 6,
|
111
|
-
[ 7,
|
112
|
-
[ 8,
|
113
|
-
[ 9,
|
114
|
-
[10,
|
115
|
-
[11,
|
116
|
-
[12,
|
117
|
-
[13,
|
118
|
-
[14,
|
119
|
-
[15,
|
120
|
-
[16,
|
121
|
-
[17,
|
122
|
-
[18,
|
123
|
-
[19,
|
124
|
-
[20,
|
125
|
-
[21,
|
126
|
-
[22,
|
127
|
-
[23,
|
128
|
-
].each do |index, token|
|
129
|
-
|
122
|
+
[ 0, :group, :capture, '(', 0, 1],
|
123
|
+
[ 1, :literal, :literal, 'a ', 1, 3],
|
124
|
+
[ 2, :group, :capture, '(', 3, 4],
|
125
|
+
[ 3, :literal, :literal, 'b', 4, 5],
|
126
|
+
[ 4, :group, :options, '(?x:', 5, 9],
|
127
|
+
[ 5, :free_space, :whitespace, ' ', 9, 10],
|
128
|
+
[ 6, :group, :capture, '(', 10, 11],
|
129
|
+
[ 7, :literal, :literal, 'c', 11, 12],
|
130
|
+
[ 8, :free_space, :whitespace, ' ', 12, 13],
|
131
|
+
[ 9, :literal, :literal, 'd', 13, 14],
|
132
|
+
[10, :group, :close, ')', 14, 15],
|
133
|
+
[11, :free_space, :whitespace, ' ', 15, 16],
|
134
|
+
[12, :group, :options, '(?-x:', 16, 21],
|
135
|
+
[13, :group, :capture, '(', 21, 22],
|
136
|
+
[14, :literal, :literal, 'e f', 22, 25],
|
137
|
+
[15, :group, :close, ')', 25, 26],
|
138
|
+
[16, :literal, :literal, ' ', 26, 27],
|
139
|
+
[17, :group, :close, ')', 27, 28],
|
140
|
+
[18, :literal, :literal, 'g', 28, 29],
|
141
|
+
[19, :group, :close, ')', 29, 30],
|
142
|
+
[20, :literal, :literal, ' h', 30, 32],
|
143
|
+
[21, :group, :close, ')', 32, 33],
|
144
|
+
[22, :literal, :literal, 'i j', 33, 36],
|
145
|
+
[23, :group, :close, ')', 36, 37]
|
146
|
+
].each do |index, type, token, text, ts, te|
|
147
|
+
result = tokens[index]
|
148
|
+
|
149
|
+
assert_equal type, result[0]
|
150
|
+
assert_equal token, result[1]
|
151
|
+
assert_equal text, result[2]
|
152
|
+
assert_equal ts, result[3]
|
153
|
+
assert_equal te, result[4]
|
130
154
|
end
|
131
155
|
end
|
132
156
|
|
data/test/scanner/test_groups.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path("../../helpers", __FILE__)
|
|
3
3
|
class ScannerGroups < Test::Unit::TestCase
|
4
4
|
|
5
5
|
tests = {
|
6
|
-
|
6
|
+
# Options
|
7
7
|
'(?-mix:abc)' => [0, :group, :options, '(?-mix:', 0, 7],
|
8
8
|
'(?m-ix:abc)' => [0, :group, :options, '(?m-ix:', 0, 7],
|
9
9
|
'(?mi-x:abc)' => [0, :group, :options, '(?mi-x:', 0, 7],
|
@@ -38,39 +38,34 @@ class ScannerGroups < Test::Unit::TestCase
|
|
38
38
|
'(?<!abc)' => [0, :assertion, :nlookbehind, '(?<!', 0, 4],
|
39
39
|
}
|
40
40
|
|
41
|
-
count = 0
|
42
|
-
tests.each do |pattern, test|
|
43
|
-
define_method "test_scan_#{test[1]}_#{test[2]}_#{count+=1}" do
|
44
|
-
|
45
|
-
tokens = RS.scan(pattern)
|
46
|
-
assert_equal( test[1,5], tokens[test[0]])
|
47
|
-
assert_equal( test[3], pattern[tokens[test[0]][3], tokens[test[0]][4]])
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
41
|
if RUBY_VERSION >= '2.0'
|
53
|
-
|
54
|
-
|
55
|
-
'(?
|
56
|
-
'(
|
57
|
-
'(?
|
58
|
-
'(?da-
|
59
|
-
'(?
|
60
|
-
'(?dau)'
|
61
|
-
'(?
|
62
|
-
'(?
|
63
|
-
'(?
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
tokens = RS.scan(pattern)
|
70
|
-
assert_equal( test[1,5], tokens[test[0]])
|
71
|
-
assert_equal( test[3], pattern[tokens[test[0]][3], tokens[test[0]][4]])
|
42
|
+
tests.merge!({
|
43
|
+
# New options
|
44
|
+
'(?d-mix:abc)' => [0, :group, :options, '(?d-mix:', 0, 8],
|
45
|
+
'(?a-mix:abc)' => [0, :group, :options, '(?a-mix:', 0, 8],
|
46
|
+
'(?u-mix:abc)' => [0, :group, :options, '(?u-mix:', 0, 8],
|
47
|
+
'(?da-m:abc)' => [0, :group, :options, '(?da-m:', 0, 7],
|
48
|
+
'(?du-x:abc)' => [0, :group, :options, '(?du-x:', 0, 7],
|
49
|
+
'(?dau-i:abc)' => [0, :group, :options, '(?dau-i:', 0, 8],
|
50
|
+
'(?dau:abc)' => [0, :group, :options, '(?dau:', 0, 6],
|
51
|
+
'(?dau)' => [0, :group, :options, '(?dau', 0, 5],
|
52
|
+
'(?d:)' => [0, :group, :options, '(?d:', 0, 4],
|
53
|
+
'(?a:)' => [0, :group, :options, '(?a:', 0, 4],
|
54
|
+
'(?u:)' => [0, :group, :options, '(?u:', 0, 4],
|
55
|
+
})
|
56
|
+
end
|
72
57
|
|
73
|
-
|
58
|
+
tests.each_with_index do |(pattern, (index, type, token, text, ts, te)), count|
|
59
|
+
define_method "test_scanner_#{type}_#{token}_#{count}" do
|
60
|
+
tokens = RS.scan(pattern)
|
61
|
+
result = tokens[index]
|
62
|
+
|
63
|
+
assert_equal type, result[0]
|
64
|
+
assert_equal token, result[1]
|
65
|
+
assert_equal text, result[2]
|
66
|
+
assert_equal ts, result[3]
|
67
|
+
assert_equal te, result[4]
|
68
|
+
assert_equal text, pattern[ts, te]
|
74
69
|
end
|
75
70
|
end
|
76
71
|
|
data/test/scanner/test_keep.rb
CHANGED
@@ -3,31 +3,33 @@ require File.expand_path("../../helpers", __FILE__)
|
|
3
3
|
class ScannerKeep < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def test_scan_keep_token
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
assert_equal
|
10
|
-
assert_equal
|
11
|
-
assert_equal
|
12
|
-
assert_equal
|
13
|
-
assert_equal
|
6
|
+
tokens = RS.scan(/ab\Kcd/)
|
7
|
+
result = tokens.at(1)
|
8
|
+
|
9
|
+
assert_equal :keep, result[0]
|
10
|
+
assert_equal :mark, result[1]
|
11
|
+
assert_equal '\\K', result[2]
|
12
|
+
assert_equal 2, result[3]
|
13
|
+
assert_equal 4, result[4]
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_scan_keep_nested
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
assert_equal
|
23
|
-
assert_equal
|
24
|
-
assert_equal
|
25
|
-
|
26
|
-
assert_equal
|
27
|
-
|
28
|
-
assert_equal
|
29
|
-
assert_equal
|
30
|
-
assert_equal
|
17
|
+
tokens = RS.scan(/(a\Kb)|(c\\\Kd)ef/)
|
18
|
+
|
19
|
+
first = tokens.at(2)
|
20
|
+
second = tokens.at(9)
|
21
|
+
|
22
|
+
assert_equal :keep, first[0]
|
23
|
+
assert_equal :mark, first[1]
|
24
|
+
assert_equal '\\K', first[2]
|
25
|
+
assert_equal 2, first[3]
|
26
|
+
assert_equal 4, first[4]
|
27
|
+
|
28
|
+
assert_equal :keep, second[0]
|
29
|
+
assert_equal :mark, second[1]
|
30
|
+
assert_equal '\\K', second[2]
|
31
|
+
assert_equal 11, second[3]
|
32
|
+
assert_equal 13, second[4]
|
31
33
|
end
|
32
34
|
|
33
35
|
end
|