Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate tests/farray-object.t @ 732:d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 07 Oct 2024 13:34:28 +0200 |
| parents | 8f1583faf9ea |
| children | 772e4999562b |
| 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 |
|
732
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
19 $ fobject_type ARRAY1 |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
20 array (no-eol) |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
21 $ farray_type ARRAY1 |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
22 array (no-eol) |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
23 $ falist_type ARRAY1 |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
24 array (no-eol) |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
25 $ 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
|
26 $ farray_append ARRAY1 "$ITEM1" |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
27 $ farray_release ITEM1 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
28 $ 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
|
29 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
|
30 $ farray_append ARRAY1 "$LIST2" |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
31 $ falist_release LIST2 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
32 $ 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
|
33 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
|
34 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
|
35 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
|
36 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
|
37 DEBUG: 3: --> |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
38 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
|
39 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
|
40 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
|
41 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
|
42 DEBUG: 4: --> |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
43 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
|
44 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
|
45 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
|
46 DEBUG: `k3' -> `v3' |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
47 $ farray_release ARRAY1 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
48 $ 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
|
49 $ 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
|
50 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
51 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
52 AList |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
53 ===== |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
54 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
55 $ falist_create LIST1 k1 v1 |
|
732
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
56 $ fobject_type LIST1 |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
57 alist (no-eol) |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
58 $ falist_type LIST1 |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
59 alist (no-eol) |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
60 $ farray_type LIST1 |
|
d92e7203a14d
farray.sh: an official function fobject_type() instead of an internal one
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
61 alist (no-eol) |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
62 $ 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
|
63 $ falist_set LIST1 k2 "$ITEM1" |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
64 $ falist_release ITEM1 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
65 $ 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
|
66 $ falist_set LIST1 k3 "$ARRAY2" |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
67 $ farray_release ARRAY2 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
68 $ 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
|
69 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
|
70 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
|
71 DEBUG: `k2': --> |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 DEBUG: `k3': --> |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
84 $ falist_release LIST1 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
85 $ 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
|
86 $ check_no_alist_artifacts |
