{"thread":{"id":"60375","subject":"[[Outreachy]PATCH v2] t/t7601: Modernize test scripts using functions","startedAt":"2023-10-16T15:52:12Z","lastAt":"2023-10-16T15:52:12Z","messageCount":1,"participants":["Dorcas AnonoLitunya"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483309","messageId":"20231016155059.137057-2-anonolitunya@gmail.com","threadId":"60375","inReplyTo":null,"subject":"[[Outreachy]PATCH v2] t/t7601: Modernize test scripts using functions","fromName":"Dorcas AnonoLitunya","fromEmail":"anonolitunya@gmail.com","sentAt":"2023-10-16T15:50:11Z","receivedAt":"2023-10-16T15:52:12Z","isPatch":false,"sender":{"key":"anonolitunya@gmail.com","avatar":"https://avatars.githubusercontent.com/u/36160963?v=4"},"body":"The test script is currently using the command format 'test -f' to\ncheck for existence or absence of files.\n\nReplace it with new helper functions following the format\n'test_path_is_file'.\n\nConsequently, the patch also replaces the inverse command '! test -f' or\n'test ! -f' with new helper function following the format\n'test_path_is_missing'\n\nThis adjustment using helper functions makes the code more readable and\neasier to understand.\n\nSigned-off-by: Dorcas AnonoLitunya <anonolitunya@gmail.com>\n---\nChanges in v2:\n  - Add Outreachy to subject line\n\n t/t7601-merge-pull-config.sh | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh\nindex bd238d89b0..e08767df66 100755\n--- a/t/t7601-merge-pull-config.sh\n+++ b/t/t7601-merge-pull-config.sh\n@@ -349,13 +349,13 @@ test_expect_success 'Cannot rebase with multiple heads' '\n \n test_expect_success 'merge c1 with c2' '\n \tgit reset --hard c1 &&\n-\ttest -f c0.c &&\n-\ttest -f c1.c &&\n-\ttest ! -f c2.c &&\n-\ttest ! -f c3.c &&\n+\ttest_path_is_file c0.c &&\n+\ttest_path_is_file c1.c &&\n+\ttest_path_is_missing c2.c &&\n+\ttest_path_is_missing c3.c &&\n \tgit merge c2 &&\n-\ttest -f c1.c &&\n-\ttest -f c2.c\n+\ttest_path_is_file c1.c &&\n+\ttest_path_is_file c2.c\n '\n \n test_expect_success 'fast-forward pull succeeds with \"true\" in pull.ff' '\n@@ -411,8 +411,8 @@ test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '\n \tgit reset --hard c1 &&\n \tgit config pull.twohead ours &&\n \tgit merge c2 &&\n-\ttest -f c1.c &&\n-\t! test -f c2.c\n+\ttest_path_is_file c1.c &&\n+\ttest_path_is_missing c2.c\n '\n \n test_expect_success 'merge c1 with c2 and c3 (recursive in pull.octopus)' '\n@@ -431,10 +431,10 @@ test_expect_success 'merge c1 with c2 and c3 (recursive and octopus in pull.octo\n \ttest \"$(git rev-parse c2)\" = \"$(git rev-parse HEAD^2)\" &&\n \ttest \"$(git rev-parse c3)\" = \"$(git rev-parse HEAD^3)\" &&\n \tgit diff --exit-code &&\n-\ttest -f c0.c &&\n-\ttest -f c1.c &&\n-\ttest -f c2.c &&\n-\ttest -f c3.c\n+\ttest_path_is_file c0.c &&\n+\ttest_path_is_file c1.c &&\n+\ttest_path_is_file c2.c &&\n+\ttest_path_is_file c3.c\n '\n \n conflict_count()\n-- \n2.42.0.345.gaab89be2eb\n\n"}]}