Ignores comment lines.
This commit is contained in:
parent
bb64ff99ac
commit
3414569db2
13
src/tap.cr
13
src/tap.cr
@ -35,12 +35,16 @@ module Tap
|
||||
tap : Tap::Suite? = nil
|
||||
|
||||
text.lines.each do |line|
|
||||
md = line.match(/^([0-9]+)\.\.([0-9]+)$/)
|
||||
if md
|
||||
if md = line.match /^[ \t]*#.*$/
|
||||
# Comments, currently ignored.
|
||||
next
|
||||
end
|
||||
|
||||
if md = line.match(/^([0-9]+)\.\.([0-9]+)$/)
|
||||
unless tap
|
||||
tap = Tap::Suite.new md[2].to_i
|
||||
else
|
||||
if (tap.size+1) != md[2].to_i
|
||||
if tap.size != md[2].to_i
|
||||
raise ParserError.new "Number of tests parsed does not match number of tests written in suite."
|
||||
end
|
||||
end
|
||||
@ -48,8 +52,7 @@ module Tap
|
||||
next
|
||||
end
|
||||
|
||||
md = line.match(/^(not ok|ok) ([0-9]+) *- *([^#]*)(#.*)?$/)
|
||||
if md
|
||||
if md = line.match(/^(not ok|ok) ([0-9]+) *- *([^#]*)(#.*)?$/)
|
||||
unless tap
|
||||
tap = Tap::Suite.new
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user