summaryrefslogtreecommitdiff
path: root/test/tc_parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/tc_parser.rb')
-rwxr-xr-xtest/tc_parser.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/tc_parser.rb b/test/tc_parser.rb
index 89339f0..d95304c 100755
--- a/test/tc_parser.rb
+++ b/test/tc_parser.rb
@@ -9,6 +9,7 @@ class ParserTest < Test::Unit::TestCase
DATADIR = 'test/parserdata'
def test_parser
return if not File::exist?(DATADIR)
+ allok = true
Dir.foreach(DATADIR) do |f|
next if f !~ /.xml$/
str = File::read(DATADIR + '/' + f)
@@ -18,15 +19,20 @@ class ParserTest < Test::Unit::TestCase
chanstr = chanstr.unpack('U*').pack('C*')
if File::exist?(DATADIR + '/' + f.gsub(/.xml$/, '.output'))
output = File::read(DATADIR + '/' + f.gsub(/.xml$/, '.output'))
- File::open(DATADIR + '/' + f.gsub(/.xml$/, '.output.new'), "w") do |f|
- f.print(chanstr)
+ File::open(DATADIR + '/' + f.gsub(/.xml$/, '.output.new'), "w") do |fd|
+ fd.print(chanstr)
+ end
+ if output != chanstr
+ puts "Test failed for #{f}. Try diff -u #{DATADIR + '/' + f.gsub(/.xml$/, '.output')}{,.new}"
+ allok = false
end
- assert_equal(output, chanstr)
else
+ puts "Missing #{DATADIR + '/' + f.gsub(/.xml$/, '.output')}."
File::open(DATADIR + '/' + f.gsub(/.xml$/, '.output.new'), "w") do |f|
f.print(chanstr)
end
end
+ assert(allok)
end
end
end