From bc7b3604e2eed4e5c7e722910fde8608cda4d507 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 20:44:11 -0500 Subject: [PATCH 01/12] aamath: check pipe_output exit code --- Formula/a/aamath.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/aamath.rb b/Formula/a/aamath.rb index 201fced1355288..c89de3a15f9922 100644 --- a/Formula/a/aamath.rb +++ b/Formula/a/aamath.rb @@ -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 From aab1280c1a3e778e0e59f9c8e2dba09df1aa6872 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 20:44:53 -0500 Subject: [PATCH 02/12] ack: check pipe_output exit code --- Formula/a/ack.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Formula/a/ack.rb b/Formula/a/ack.rb index f3f0cfa1fc9f5b..b16fed4529b029 100644 --- a/Formula/a/ack.rb +++ b/Formula/a/ack.rb @@ -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 From cd37843d4a50ae5ea08a45596582c2b865a01374 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 20:46:02 -0500 Subject: [PATCH 03/12] aescrypt: check pipe_output exit code --- Formula/a/aescrypt.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/a/aescrypt.rb b/Formula/a/aescrypt.rb index f82a65fd20b7d0..dfe8c1072296ea 100644 --- a/Formula/a/aescrypt.rb +++ b/Formula/a/aescrypt.rb @@ -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 From 6bf214470cbf0cad2ef447d33c559e0d3d047dc2 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 20:46:31 -0500 Subject: [PATCH 04/12] aespipe: check pipe_output exit code --- Formula/a/aespipe.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/a/aespipe.rb b/Formula/a/aespipe.rb index ed11eca1546521..c494c9c5515d10 100644 --- a/Formula/a/aespipe.rb +++ b/Formula/a/aespipe.rb @@ -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 From fc88eecc079d3a8978b513a7ed09646e0ee5edbd Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 20:47:27 -0500 Subject: [PATCH 05/12] afio: check pipe_output exit code --- Formula/a/afio.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/afio.rb b/Formula/a/afio.rb index 586e1a1b883feb..aa08da4768f8f2 100644 --- a/Formula/a/afio.rb +++ b/Formula/a/afio.rb @@ -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 From 5a4e5525917a17f55eb574a67322222eeefe6043 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:04:45 -0500 Subject: [PATCH 06/12] afuse: test with shell_output --- Formula/a/afuse.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/afuse.rb b/Formula/a/afuse.rb index d447b81bb6c43d..ce9d4f0cce0f2a 100644 --- a/Formula/a/afuse.rb +++ b/Formula/a/afuse.rb @@ -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 From 7937b709d7d420e0b362086112be7b9317489bd2 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:05:43 -0500 Subject: [PATCH 07/12] age: check pipe_output exit code --- Formula/a/age.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/age.rb b/Formula/a/age.rb index eaf5f9c594cabf..a3a4cca6d54b66 100644 --- a/Formula/a/age.rb +++ b/Formula/a/age.rb @@ -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 From c11419c06d505d7ec8f33e07dfc7d5df4725cd93 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:07:32 -0500 Subject: [PATCH 08/12] aiven-client: test with shell_output --- Formula/a/aiven-client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/aiven-client.rb b/Formula/a/aiven-client.rb index fef3de46478bd7..adf6c2f0bd892f 100644 --- a/Formula/a/aiven-client.rb +++ b/Formula/a/aiven-client.rb @@ -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 From 04a5d9804c3388d092a2de56ed04fe5529634190 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:09:31 -0500 Subject: [PATCH 09/12] aha: check pipe_output exit code --- Formula/a/aha.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/aha.rb b/Formula/a/aha.rb index 4ec805026ffea5..93ad2c79d871e5 100644 --- a/Formula/a/aha.rb +++ b/Formula/a/aha.rb @@ -27,7 +27,7 @@ def install end test do - out = pipe_output(bin/"aha", "rainpill") + out = pipe_output(bin/"aha", "rainpill", 0) assert_match(/color:purple;">rain.*color:blue;">pill/, out) end end From 870e9c05aead5948b1c87fb46cf323b2a39ad23a Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:09:37 -0500 Subject: [PATCH 10/12] aldo: check pipe_output exit code --- Formula/a/aldo.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/aldo.rb b/Formula/a/aldo.rb index 96d7f21a1c8882..ae3c77f56384e3 100644 --- a/Formula/a/aldo.rb +++ b/Formula/a/aldo.rb @@ -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 From d7a92384ee224eaeb602d4a88ed0a38729d2e180 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:10:01 -0500 Subject: [PATCH 11/12] align: check pipe_output exit code --- Formula/a/align.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/align.rb b/Formula/a/align.rb index 1aef5f4ffd9fa2..261231881be1f1 100644 --- a/Formula/a/align.rb +++ b/Formula/a/align.rb @@ -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 From 6dff3c97a40839274cba080ad6d41cb4112729e6 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 2 Jan 2025 21:10:14 -0500 Subject: [PATCH 12/12] analog: test with shell_output --- Formula/a/analog.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/a/analog.rb b/Formula/a/analog.rb index 6c98831d9435f9..56b590f840bdbc 100644 --- a/Formula/a/analog.rb +++ b/Formula/a/analog.rb @@ -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