aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike Naberezny2014-04-16 16:34:10 -0700
committerAdam Vandenberg2014-04-16 18:58:40 -0700
commit81aed31ba952fb6f88d9bc14e8f2534a3053ce85 (patch)
treef614ae7873c50aec3dd71b76cba42a0a2931efe8 /Library
parenta050fcfff772a735406dc415aa3ffa717dcda728 (diff)
downloadhomebrew-81aed31ba952fb6f88d9bc14e8f2534a3053ce85.tar.bz2
lrzip: add test
Closes #28461. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/lrzip.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Formula/lrzip.rb b/Library/Formula/lrzip.rb
index 61bf5e82f..ccf91597f 100644
--- a/Library/Formula/lrzip.rb
+++ b/Library/Formula/lrzip.rb
@@ -14,4 +14,18 @@ class Lrzip < Formula
system "make"
system "make install"
end
+
+ test do
+ path = testpath/"data.txt"
+ original_contents = "." * 1000
+ path.write original_contents
+
+ # compress: data.txt -> data.txt.lrz
+ system bin/"lrzip", "-o", "#{path}.lrz", path
+ path.unlink
+
+ # decompress: data.txt.lrz -> data.txt
+ system bin/"lrzip", "-d", "#{path}.lrz"
+ assert_equal original_contents, path.read
+ end
end