diff tests/farray-alist.t @ 739:dae85cddc47b

farray.sh: implement "falist_add()"
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 07 Oct 2024 23:39:01 +0200
parents 772e4999562b
children 6fcf7da87981
line wrap: on
line diff
--- a/tests/farray-alist.t	Mon Oct 07 17:30:10 2024 +0200
+++ b/tests/farray-alist.t	Mon Oct 07 23:39:01 2024 +0200
@@ -134,6 +134,32 @@
   $ check_no_alist_artifacts
 
 
+Add
+===
+
+  $ falist_create LIST
+  $ falist_add LIST K1 'V 1'
+  $ falist_add LIST K2 'V 2'
+  $ falist_add LIST K3 $'" 111222333" \\\'444555666 '    # '
+  $ falist_debug LIST
+  DEBUG: alist `LIST' has length 3
+  DEBUG:   the items:
+  DEBUG:     `K1' -> `V 1'
+  DEBUG:     `K2' -> `V 2'
+  DEBUG:     `K3' -> `" 111222333" \'444555666 '
+Yes: make a duplicate key
+  $ falist_add LIST K3 $'" 111222333" \\\'444555666 '    #
+  $ falist_debug LIST
+  DEBUG: alist `LIST' has length 4
+  DEBUG:   the items:
+  DEBUG:     `K1' -> `V 1'
+  DEBUG:     `K2' -> `V 2'
+  DEBUG:     `K3' -> `" 111222333" \'444555666 '
+  DEBUG:     `K3' -> `" 111222333" \'444555666 '
+  $ falist_release LIST
+  $ check_no_alist_artifacts
+
+
 Iteration
 =========