summaryrefslogtreecommitdiff
path: root/test/tc_parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/tc_parser.rb')
-rwxr-xr-xtest/tc_parser.rb39
1 files changed, 0 insertions, 39 deletions
diff --git a/test/tc_parser.rb b/test/tc_parser.rb
deleted file mode 100755
index 6dbf27e..0000000
--- a/test/tc_parser.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/ruby -w
-
-$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
-
-require 'test/unit'
-require 'feed2imap/channel'
-
-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$/
-# puts "Checking #{f}"
- str = File::read(DATADIR + '/' + f)
- chan = Channel::new(str)
- # for easier reading, go to ISO
- chanstr = chan.to_s
- 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 |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
- else
- puts "Missing #{DATADIR + '/' + f.gsub(/.xml$/, '.output')}."
- File::open(DATADIR + '/' + f.gsub(/.xml$/, '.output.new'), "w") do |f|
- f.print(chanstr)
- end
- end
- end
- assert(allok)
- end
-end