diff options
author | Pjotr Prins | 2021-08-25 10:55:14 +0200 |
---|---|---|
committer | Pjotr Prins | 2021-08-25 10:55:14 +0200 |
commit | b0c7f0ed464b134d1fdf6acd050f122a5ca96801 (patch) | |
tree | 6b61ad9790332fe5b001348b1c306f481bdf7943 /test/lib | |
parent | bda453acb2aa202a0703e8863fead0f2289c0192 (diff) | |
download | pangemma-b0c7f0ed464b134d1fdf6acd050f122a5ca96801.tar.gz |
New test suite is working and takes account of round-off problems.
Closes #247
Closes #242
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/test-helpers.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/lib/test-helpers.rb b/test/lib/test-helpers.rb index d2989e0..672a2c2 100644 --- a/test/lib/test-helpers.rb +++ b/test/lib/test-helpers.rb @@ -2,7 +2,7 @@ module TestHelpers # Runs gemma and returns true if successful def gemma(opts) - system("./bin/gemma #{opts}") + assert system("./bin/gemma #{opts}") end def read(fn, line=0) @@ -18,11 +18,15 @@ module TestHelpers lines = lines.map { |l| l.split("\t") } # avoid this for large files list.each do | l | line,colnum,value = l - if line == :max - cols = lines.max_by {|a| a[colnum].to_f} - else - cols = lines[line] + if colnum.is_a? String + colnum = lines[0].index(colnum) end + cols = + if line == :max + lines.max_by {|a| a[colnum].to_f} + else + lines[line] + end # assert_equal value,cols[colnum] assert_in_delta value.to_f,cols[colnum].to_f, 0.001 end |