test/tc_parse_997.rb in X12-0.1.0 vs test/tc_parse_997.rb in X12-1.1.0
- old
+ new
@@ -25,12 +25,12 @@
require 'test/unit'
class Test997Parse < Test::Unit::TestCase
@@p = nil
- @@parser = X12::Parser.new('misc/997.d12')
- @@times = 1000
+# @@parser = X12::Parser.new('misc/997single.xml')
+ @@parser = X12::Parser.new('misc/997.xml')
def setup
unless @@p
@@m997=<<-EOT
ST*997*2878~
@@ -128,19 +128,19 @@
assert_equal('', @r.L1000.AK8.TransactionSetIdentifierCode.to_s)
end # test_absent
def test_timing
start = Time::now
- @@times.times do
+ X12::TEST_REPEAT.times do
@r = @@parser.parse('997', @@m997)
test_ST
test_AK1
test_AK2
test_AK4
test_L1010
test_absent
end
finish = Time::now
- puts "Parses per second, 997: #{@@times.to_f/(finish-start)}, elapsed: #{finish-start}"
+ puts sprintf("Parses per second, 997: %.2f, elapsed: %.1f", X12::TEST_REPEAT.to_f/(finish-start), finish-start)
end # test_timing
end # TestList