diff tests/farray-alist.t @ 726:23f6d2993fa2

farray.sh: Test the debug output and the destruction of complex objects. BUGS: No formal ownership management is done yet. It is planned to implement resource management with reference counting.
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 06 Oct 2024 16:19:45 +0200
parents 3adb26525b19
children 858f4208d9cb
line wrap: on
line diff
--- a/tests/farray-alist.t	Sun Oct 06 05:56:27 2024 +0200
+++ b/tests/farray-alist.t	Sun Oct 06 16:19:45 2024 +0200
@@ -428,3 +428,22 @@
   $ LIST=''
   $ _farr_destroy_object "$LIST"
   $ check_no_alist_artifacts
+
+
+Complex Debug
+=============
+
+  $ falist_create LIST
+  $ falist_set LIST K1 V1
+  $ falist_create ITEM1 K11 V11 K22 V22
+# This also transfers ownership
+  $ falist_set LIST K2 "$ITEM1"
+  $ falist_debug LIST
+  DEBUG: alist `LIST' has length 2
+  DEBUG:     `K1' -> `V1'
+  DEBUG:     `K2': -->
+      DEBUG: alist with token `[a-f0-9]+' has length 2 (re)
+      DEBUG:     `K11' -> `V11'
+      DEBUG:     `K22' -> `V22'
+  $ falist_destroy LIST
+  $ check_no_alist_artifacts