annotate tests/farray-object.t @ 728:858f4208d9cb

farray.sh: Resource management by reference counting done
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 07 Oct 2024 12:36:18 +0200
parents 23f6d2993fa2
children 8f1583faf9ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
726
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
1 Complex object tests of farray.sh
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
2
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
3 Shell is /bin/sh.
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
4
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
5
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
6 Setup
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
7 =====
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
8
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
9 $ set -u
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
10 $ . "${TESTDIR}/testsetup.sh"
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
11 $ _p_datadir="${TESTDIR}/../share/local-bsdtools"
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
12 $ . "${_p_datadir}/farray.sh"
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
13
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
14
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
15 Array
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
16 =====
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
17
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
18 $ farray_create ARRAY1 i1 i2
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
19 $ farray_create ITEM1 i11 i22
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
20 $ farray_append ARRAY1 "$ITEM1"
728
858f4208d9cb farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents: 726
diff changeset
21 $ farray_destroy ITEM1
726
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
22 $ falist_create LIST2 k1 v1 k2 v2 k3 v3
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
23 This also transfers ownership
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
24 $ farray_append ARRAY1 "$LIST2"
728
858f4208d9cb farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents: 726
diff changeset
25 $ falist_destroy LIST2
726
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
26 $ farray_debug ARRAY1
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
27 DEBUG: array `ARRAY1' has length 4
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
28 DEBUG: its contents:
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
29 DEBUG: 1: `i1'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
30 DEBUG: 2: `i2'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
31 DEBUG: 3: -->
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
32 DEBUG: array with token `[a-f0-9]+' has length 2 (re)
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
33 DEBUG: its contents:
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
34 DEBUG: 1: `i11'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
35 DEBUG: 2: `i22'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
36 DEBUG: 4: -->
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
37 DEBUG: alist with token `[a-f0-9]+' has length 3 (re)
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
38 DEBUG: `k1' -> `v1'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
39 DEBUG: `k2' -> `v2'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
40 DEBUG: `k3' -> `v3'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
41 $ farray_destroy ARRAY1
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
42 $ check_no_array_artifacts
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
43 $ check_no_alist_artifacts
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
44
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
45
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
46 AList
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
47 =====
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
48
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
49 $ falist_create LIST1 k1 v1
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
50 $ falist_create ITEM1 k11 v11 k22 v22 k33 v33 k44 v44
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
51 $ falist_set LIST1 k2 "$ITEM1"
728
858f4208d9cb farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents: 726
diff changeset
52 $ falist_destroy ITEM1
726
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
53 $ farray_create ARRAY2 a1 a2 a3
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
54 $ falist_set LIST1 k3 "$ARRAY2"
728
858f4208d9cb farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents: 726
diff changeset
55 $ farray_destroy ARRAY2
726
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
56 $ falist_debug LIST1
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
57 DEBUG: alist `LIST1' has length 3
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
58 DEBUG: `k1' -> `v1'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
59 DEBUG: `k2': -->
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
60 DEBUG: alist with token `[a-f0-9]+' has length 4 (re)
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
61 DEBUG: `k11' -> `v11'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
62 DEBUG: `k22' -> `v22'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
63 DEBUG: `k33' -> `v33'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
64 DEBUG: `k44' -> `v44'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
65 DEBUG: `k3': -->
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
66 DEBUG: array with token `[a-f0-9]+' has length 3 (re)
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
67 DEBUG: its contents:
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
68 DEBUG: 1: `a1'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
69 DEBUG: 2: `a2'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
70 DEBUG: 3: `a3'
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
71
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
72 $ falist_destroy LIST1
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
73 $ check_no_array_artifacts
23f6d2993fa2 farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
74 $ check_no_alist_artifacts