Skip to content

Commit d09f161

Browse files
authored
Merge pull request #233795 from Homebrew/lz4-simplify
lz4: simplify test
2 parents 733dbf2 + 2ee514d commit d09f161

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Formula/l/lz4.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ def install
3535

3636
test do
3737
input = "testing compression and decompression"
38-
input_file = testpath/"in"
39-
input_file.write input
40-
output_file = testpath/"out"
41-
system "sh", "-c", "cat #{input_file} | #{bin}/lz4 | #{bin}/lz4 -d > #{output_file}"
42-
assert_equal output_file.read, input
38+
compressed = pipe_output(bin/"lz4", input)
39+
refute_empty compressed
40+
decompressed = pipe_output("#{bin}/lz4 -d", compressed)
41+
assert_equal decompressed, input
4342
end
4443
end

0 commit comments

Comments
 (0)