diff tests/farray-alist.t @ 615:454ce7fa25c8

farray.sh: Implement falist_items(), falist_keys() and falist_values()
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 20 Sep 2024 00:24:09 +0200
parents 62fbc4316d97
children 57ee25cec0dd
line wrap: on
line diff
--- a/tests/farray-alist.t	Thu Sep 19 22:20:02 2024 +0200
+++ b/tests/farray-alist.t	Fri Sep 20 00:24:09 2024 +0200
@@ -315,4 +315,41 @@
   $ falist_destroy UPDATE2
   $ falist_destroy EMPTY
 
-  $ check_no_alist_artifacts
\ No newline at end of file
+  $ check_no_alist_artifacts
+
+
+Items / Keys / Values
+=====================
+
+  $ farray_create KEYS
+  $ farray_create VALUES
+  $ farray_create ITEMS
+  $ falist_create LIST "Key 1" "Value 1" "Key 2" 'Value 2 '\'''
+  $ falist_items ITEMS LIST
+  $ farray_debug ITEMS
+  DEBUG: array `ITEMS' has length 4
+  DEBUG:   its contents:
+  DEBUG:     1: `Key 1'
+  DEBUG:     2: `Value 1'
+  DEBUG:     3: `Key 2'
+  DEBUG:     4: `Value 2 ''
+  $ falist_keys KEYS LIST
+  $ farray_debug KEYS
+  DEBUG: array `KEYS' has length 2
+  DEBUG:   its contents:
+  DEBUG:     1: `Key 1'
+  DEBUG:     2: `Key 2'
+  $ falist_values VALUES LIST
+  $ farray_debug VALUES
+  DEBUG: array `VALUES' has length 2
+  DEBUG:   its contents:
+  DEBUG:     1: `Value 1'
+  DEBUG:     2: `Value 2 ''
+
+  $ falist_destroy LIST
+  $ farray_destroy KEYS
+  $ farray_destroy VALUES
+  $ farray_destroy ITEMS
+
+  $ check_no_alist_artifacts
+  $ check_no_array_artifacts