Skip to content

Commit

Permalink
Merge pull request Homebrew#203082 from Homebrew/pipe_output-a-1
Browse files Browse the repository at this point in the history
a*: check pipe_output exit code
  • Loading branch information
BrewTestBot authored Jan 3, 2025
2 parents c1303b3 + 6dff3c9 commit 8dc4976
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Formula/a/aamath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def install
end

test do
s = pipe_output(bin/"aamath", (prefix/"testcases").read)
s = pipe_output(bin/"aamath", (prefix/"testcases").read, 0)
assert_match "f(x + h) = f(x) + h f'(x)", s
end
end
3 changes: 1 addition & 2 deletions Formula/a/ack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def install
end

test do
assert_equal "foo bar\n", pipe_output("#{bin}/ack --noenv --nocolor bar -",
"foo\nfoo bar\nbaz")
assert_equal "foo bar\n", pipe_output("#{bin}/ack --noenv --nocolor bar -", "foo\nfoo bar\nbaz", 0)
end
end
4 changes: 2 additions & 2 deletions Formula/a/aescrypt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def install
test do
(testpath/"key").write "kk=12345678901234567890123456789abc0"
original_text = "hello"
cipher_text = pipe_output("#{bin}/aescrypt -k #{testpath}/key -s 128", original_text)
deciphered_text = pipe_output("#{bin}/aesget -k #{testpath}/key -s 128", cipher_text)
cipher_text = pipe_output("#{bin}/aescrypt -k #{testpath}/key -s 128", original_text, 0)
deciphered_text = pipe_output("#{bin}/aesget -k #{testpath}/key -s 128", cipher_text, 0)
refute_equal original_text, cipher_text
assert_equal original_text, deciphered_text
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/a/aespipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def install
test do
(testpath/"secret").write "thisismysecrethomebrewdonttellitplease"
msg = "Hello this is Homebrew"
encrypted = pipe_output("#{bin}/aespipe -P secret", msg)
decrypted = pipe_output("#{bin}/aespipe -P secret -d", encrypted)
encrypted = pipe_output("#{bin}/aespipe -P secret", msg, 0)
decrypted = pipe_output("#{bin}/aespipe -P secret -d", encrypted, 0)
assert_equal msg, decrypted.gsub(/\x0+$/, "")
end
end
2 changes: 1 addition & 1 deletion Formula/a/afio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def install
test do
path = testpath/"test"
path.write "homebrew"
pipe_output("#{bin}/afio -o archive", "test\n")
pipe_output("#{bin}/afio -o archive", "test\n", 0)

system bin/"afio", "-r", "archive"
path.unlink
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/afuse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ def install
end

test do
assert_match "FUSE library version", pipe_output("#{bin}/afuse --version 2>&1")
assert_match "FUSE library version", shell_output("#{bin}/afuse --version 2>&1", 1)
end
end
2 changes: 1 addition & 1 deletion Formula/a/age.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def install

test do
system bin/"age-keygen", "-o", "key.txt"
pipe_output("#{bin}/age -e -i key.txt -o test.age", "test")
pipe_output("#{bin}/age -e -i key.txt -o test.age", "test", 0)
assert_equal "test", shell_output("#{bin}/age -d -i key.txt test.age")
end
end
2 changes: 1 addition & 1 deletion Formula/a/aha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def install
end

test do
out = pipe_output(bin/"aha", "[35mrain[34mpill[00m")
out = pipe_output(bin/"aha", "[35mrain[34mpill[00m", 0)
assert_match(/color:purple;">rain.*color:blue;">pill/, out)
end
end
2 changes: 1 addition & 1 deletion Formula/a/aiven-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def install

test do
assert_match "aiven-client", shell_output("#{bin}/avn --version")
assert_match "UserError: not authenticated", pipe_output("AIVEN_CONFIG_DIR=/tmp #{bin}/avn user info 2>&1")
assert_match "UserError: not authenticated", shell_output("AIVEN_CONFIG_DIR=/tmp #{bin}/avn user info 2>&1", 1)
end
end
2 changes: 1 addition & 1 deletion Formula/a/aldo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ def install
end

test do
assert_match "Aldo #{version} Main Menu", pipe_output(bin/"aldo", "6")
assert_match "Aldo #{version} Main Menu", pipe_output(bin/"aldo", "6", 0)
end
end
2 changes: 1 addition & 1 deletion Formula/a/align.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ def install
end

test do
assert_equal " 1 1\n12 12\n", pipe_output(bin/"align", "1 1\n12 12\n")
assert_equal " 1 1\n12 12\n", pipe_output(bin/"align", "1 1\n12 12\n", 0)
end
end
2 changes: 1 addition & 1 deletion Formula/a/analog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def install
end

test do
output = pipe_output("#{bin}/analog #{pkgshare}/examples/logfile.log")
output = shell_output("#{bin}/analog #{pkgshare}/examples/logfile.log")
assert_match "(United Kingdom)", output
end
end

0 comments on commit 8dc4976

Please sign in to comment.