From: Carlos López via GitGitGadget Date: Wed, 22 Jun 2022 17:07:08 GMT Subject: [PATCH v3 2/2] tests: add tests for grep --max-count Message-ID: <525958af877c3bbd024ffd3aee0c64e469c3d6cf.1655917628.git.gitgitgadget@gmail.com> In-Reply-To: From: =?UTF-8?q?Carlos=20L=C3=B3pez?= <00xc@protonmail.com> Add tests for grep's -m / --max-count to check if the option correctly outputs limited results, and that it interacts properly with other flags that could likely be used in conjunction. Signed-off-by: Carlos López 00xc@protonmail.com --- t/t7810-grep.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 69356011713..7b1b8a3cd93 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -77,6 +77,7 @@ test_expect_success setup ' # Say hello. function hello() { echo "Hello world." + echo "Hello again." } # hello # Still a no-op. @@ -595,6 +596,88 @@ test_expect_success 'grep --files-without-match --quiet' ' test_must_be_empty actual ' +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + +cat >expected <actual && + test_cmp expected actual +' + cat >expected <