Skip to content

Commit

Permalink
we don't need to do "cat X | foo" when we can do "foo X"
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Oct 15, 2023
1 parent 27807b3 commit 7771539
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/tests/modules/linelog/linelog.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ else {
test_fail
}

&Tmp-Integer-0 := `/bin/sh -c "cat $ENV{MODULE_TEST_DIR}/test_e.log | wc -l"`
&Tmp-Integer-0 := `/bin/sh -c "wc -l $ENV{MODULE_TEST_DIR}/test_e.log"`

if (&Tmp-Integer-0 == 3) {
test_pass
Expand Down
6 changes: 3 additions & 3 deletions src/tests/modules/smtp/smtp_attachment/tls_attachment.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ echo $?"` == "1") {
# Pull out the base64 encoded test, decode it, trim line endings
# Compare the result with the expected output
#
if !(`/bin/sh -c "cat build/ci/exim4/mail/smtp_attachment_receiver | \
grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' | base64 -d | tr -d '\r\n' | \
grep -f build/ci/exim4/testfile"`){
if !(`/bin/sh -c "grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' build/ci/exim4/mail/smtp_attachment_receiver | \
base64 -d | tr -d '\r\n' | \
grep -f build/ci/exim4/testfile"`) {
test_fail
}

Expand Down
3 changes: 1 addition & 2 deletions src/tests/modules/smtp/smtp_crln/tls_crln.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ echo $?"` == "1") {
test_fail
}

if !(`/bin/sh -c "cat build/ci/exim4/mail/crln_test_receiver | \
grep -E 'Most Body'"`) {
if !(`/bin/sh -c "grep -E 'Most Body' build/ci/exim4/mail/crln_test_receiver"`) {
test_fail
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ echo $?"` == "1") {
test_fail
}

if !(`/bin/sh -c "cat build/ci/exim4/mail/stringparse_test_receiver | \
grep -E 'Subject: for Bob'"`) {
if !(`/bin/sh -c "grep -E 'Subject: for Bob' build/ci/exim4/mail/stringparse_test_receiver"`) {
test_fail
}

Expand Down
6 changes: 3 additions & 3 deletions src/tests/modules/smtp/tls_delivery.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ done ;"` == "found")) {
# Pull out the base64 encoded test, decode it, trim line endings
# Compare the result with the expected output
#
if !(`/bin/sh -c "cat build/ci/exim4/mail/smtp_delivery_receiver | \
grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' | base64 -d | tr -d '\r\n' | \
grep -f build/ci/exim4/testfile"`){
if !(`/bin/sh -c "grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' build/ci/exim4/mail/smtp_delivery_receiver | \
base64 -d | tr -d '\r\n' | \
grep -f build/ci/exim4/testfile"`){
test_fail
}

Expand Down

0 comments on commit 7771539

Please sign in to comment.