newick-utils: improve test
This commit is contained in:
parent
1ac1c66f4e
commit
053ae7e259
1 changed files with 18 additions and 2 deletions
|
@ -18,8 +18,24 @@ class NewickUtils < Formula
|
||||||
system "make install"
|
system "make install"
|
||||||
end
|
end
|
||||||
|
|
||||||
def test
|
test do
|
||||||
system "echo '(B:1,C:2)A;' | #{bin}/nw_display -"
|
require 'open3'
|
||||||
|
|
||||||
|
expected = <<-EOS
|
||||||
|
+-------------------------------------+ B
|
||||||
|
=| A
|
||||||
|
+---------------------------------------------------------------------------+ C
|
||||||
|
|
||||||
|
|------------------|------------------|------------------|------------------|
|
||||||
|
0 0.5 1 1.5 2
|
||||||
|
substitutions/site
|
||||||
|
EOS
|
||||||
|
|
||||||
|
Open3.popen3("#{bin}/nw_display", "-") do |stdin, stdout, _|
|
||||||
|
stdin.write("(B:1,C:2)A;\n")
|
||||||
|
stdin.close
|
||||||
|
expected == stdout.read.split("\n").map(&:rstrip).join("\n")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue