Failure が発生した時に表示が崩れる問題を解消した。
@@ -63,15 +63,10 @@ | ||
63 | 63 | end |
64 | 64 | |
65 | 65 | while error_content.length > 0 |
66 | - if /^ [0-9]+\) (Failure|Error):\s+?(.+?)\(.+?\)( \[(.+?)\])?:.*?^(.+)/m =~ error_content | |
67 | - test_method = $2 | |
68 | - test_cls = $3 | |
69 | - error_line = $4 | |
70 | - error_content = $5 | |
66 | + (matched, test_cls, test_method, error_line, error_content) = __match_failure_or_error(error_content) | |
67 | + if matched then | |
71 | 68 | __set_result(test_source, test_cls, test_method, 'error_line', error_line) |
72 | 69 | |
73 | - STDERR.puts "error_content => #{error_content}" | |
74 | - | |
75 | 70 | if /(.+?)(^ [0-9]+\) (Failure|Error):\s+?(.+?)\(.+?\)( \[(.+?)\])?:.*^(.+))/m =~ error_content then |
76 | 71 | __set_result(test_source, test_cls, test_method, 'error_report', $1) |
77 | 72 | error_content = $2 |
@@ -279,6 +274,18 @@ | ||
279 | 274 | @result[test_source][test_cls][test_method][name] = value |
280 | 275 | end |
281 | 276 | |
277 | + def __match_failure_or_error(error_content) | |
278 | + if /^ [0-9]+\) Failure:\s+?(.+?)\((.+?)\) \[(.+?)\]:.*?^(.+)/m =~ error_content then | |
279 | + return [true, $2, $1, $3, $4] | |
280 | + end | |
281 | + | |
282 | + if /^ [0-9]+\) Error:\s+?(.+?)\((.+?)\):.*?^(.+)/m =~ error_content then | |
283 | + return [true, $2, $1, nil, $3] | |
284 | + end | |
285 | + | |
286 | + return [false, nil, nil, nil] | |
287 | + end | |
288 | + | |
282 | 289 | def __encode(content) |
283 | 290 | if @to_encoding != nil then |
284 | 291 | if @from_encoding != nil then |