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

[RFC PATCH 5/5] t0016: add 'add' and 'get_all' subcommand test

From
Christian Couder <christian.couder@gmail.com>
Date
Jul 7, 2019, 08:30 UTC
Message-ID
<20190707083002.7037-6-chriscool@tuxfamily.org>
In-Reply-To
<20190707083002.7037-1-chriscool@tuxfamily.org>

Let's add a test case to test both the 'add' and 'get_all' subcommand from "test-oidmap.c", and through them oidmap_add() and oidmap_get_next() from "oidmap.{c,h}".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/t0016-oidmap.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff --git a/t/t0016-oidmap.sh b/t/t0016-oidmap.sh
index bbe719e950..1d3196d624 100755
--- a/t/t0016-oidmap.sh
+++ b/t/t0016-oidmap.sh
@@ -67,6 +67,32 @@ Unknown oid: invalidOid
 
 '
 
+test_expect_success 'add and get_all' '
+
+test_oidmap "add one 1
+add one un
+add two 2
+add two deux
+add three 3
+get_all two
+get_all four
+get_all invalidOid
+get_all three
+get_all one" "1
+un
+2
+deux
+3
+deux
+2
+NULL
+Unknown oid: invalidOid
+3
+un
+1"
+
+'
+
 test_expect_success 'remove' '
 
 test_oidmap "put one 1
-- 
2.22.0.514.g3228928bce.dirty
Previous: Christian CouderNext: Junio C Hamano
Message 6 of 9 in “oidmap: handle entries with the same key”
  1. 0/5 oidmap: handle entries with the same keyChristian Couder, Jul 7, 2019
  2. 1/5 oidmap: add oidmap_add()Christian Couder, Jul 7, 2019
  3. 2/5 oidmap: add oidmap_get_next()Christian Couder, Jul 7, 2019
  4. 3/5 test-oidmap: add back proper 'add' subcommandChristian Couder, Jul 7, 2019
  5. 4/5 test-oidmap: add 'get_all' subcommandChristian Couder, Jul 7, 2019
  6. 5/5 t0016: add 'add' and 'get_all' subcommand testChristian Couder, Jul 7, 2019
  7. Junio C HamanoJul 8, 2019
  8. Junio C HamanoJul 12, 2019
  9. Jeff KingJul 12, 2019

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.