git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] tests(scalar): tighten the stale `scalar.repo` test some

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 10, 2022, 07:28 UTC
Message-ID
<pull.1415.git.1668065327120.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

As pointed out by Stolee, the previous incarnation of this test case was not stringent enough: we want to verify that _only_ the stale entries are removed (previously, the test case would have succeeded even if all entries had been removed).

Let's rectify this and verify that the other entries are left intact.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    tests(scalar): tighten the stale scalar.repo test some
    
    A follow-up for a topic already in next.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1415%2Fdscho%2Ftighten-stale-scalar.repos-test-case-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1415/dscho/tighten-stale-scalar.repos-test-case-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1415
 t/t9210-scalar.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
index c7f8a379108..25f500cf682 100755
--- a/t/t9210-scalar.sh
+++ b/t/t9210-scalar.sh
@@ -171,10 +171,13 @@ test_expect_success '`reconfigure -a` removes stale config entries' '
 	scalar register stale &&
 	scalar list >scalar.repos &&
 	grep stale scalar.repos &&
+
+	grep -v stale scalar.repos >expect &&
+
 	rm -rf stale &&
 	scalar reconfigure -a &&
 	scalar list >scalar.repos &&
-	! grep stale scalar.repos
+	test_cmp expect scalar.repos
 '
 
 test_expect_success 'scalar delete without enlistment shows a usage' '

base-commit: c90db53d203d7ade1dc7abe63857cfb5616fe34f
-- 
gitgitgadget
Next: Derrick Stolee
Message 1 of 3 in “tests(scalar): tighten the stale `scalar.repo` test some”
  1. tests(scalar): tighten the stale `scalar.repo` test someJohannes Schindelin via GitGitGadget, Nov 10, 2022
  2. Derrick StoleeNov 10, 2022
  3. Taylor BlauNov 11, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.