Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate tests/farray-alist.t @ 807:ed94334bc6f1
fports: Update manual pages to show the now current syntax
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 05 Nov 2024 11:18:52 +0100 |
| parents | 03350d2a2af6 |
| children |
| rev | line source |
|---|---|
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 Basic tests of farray.sh's falist_XXX functions |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 Shell is /bin/sh. |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
4 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
5 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
6 Setup |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
7 ===== |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
8 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
9 $ set -u |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
10 $ . "${TESTDIR}/testsetup.sh" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
11 $ _p_datadir="${TESTDIR}/../share/local-bsdtools" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
12 $ . "${_p_datadir}/farray.sh" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
13 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
14 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
15 Basic Creation and Destruction |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
16 ============================== |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
17 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
18 Create an empty alist |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
19 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
20 $ falist_create LIST |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
21 Has some initial global variables set |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
22 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
23 _farr_KV_[a-f0-9]+_B=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
24 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
25 _farr_KV_[a-f0-9]+_P='0;0' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
26 _farr_KV_[a-f0-9]+__=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
27 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
28 |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
29 $ falist_length _i LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
30 $ echo "$_i" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
31 0 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
32 $ test "${_i}" -eq 0 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
33 $ falist_print_length LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
34 0 (no-eol) |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
35 |
|
651
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
36 $ falist_istrue LIST |
|
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
37 [1] |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
38 $ falist_debug LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
39 DEBUG: alist `LIST' has length 0 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
40 |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
41 $ falist_release LIST |
|
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
42 $ ( falist_release LIST ) |
|
716
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
43 ERROR: object `LIST' not created properly: token empty |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
44 [1] |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
45 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
46 $ check_no_alist_artifacts |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
47 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
48 $ falist_create LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
49 $ falist_clear LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
50 $ falist_istrue LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
51 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
52 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
53 DEBUG: alist `LIST' has length 0 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
54 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
55 $ ( falist_release LIST ) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
56 ERROR: object `LIST' not created properly: token empty |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
57 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
58 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
59 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
60 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
61 Creation and Destruction with one Item |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
62 ====================================== |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
63 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
64 Create an alist with one item |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
65 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
66 $ falist_create LIST K1 V1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
67 $ falist_length _i LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
68 $ echo "$_i" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
69 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
70 $ test "${_i}" -eq 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
71 $ falist_print_length LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
72 1 (no-eol) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
73 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
74 $ falist_istrue LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
75 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
76 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
77 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
78 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
79 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
80 $ ( falist_release LIST ) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
81 ERROR: object `LIST' not created properly: token empty |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
82 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
83 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
84 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
85 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
86 One Item that replaces the first item |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
87 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
88 $ falist_create LIST K1 V1 K1 "V1 1" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
89 $ falist_length _i LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
90 $ echo "$_i" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
91 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
92 $ test "${_i}" -eq 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
93 $ falist_print_length LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
94 1 (no-eol) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
95 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
96 $ falist_istrue LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
97 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
98 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
99 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
100 DEBUG: `K1' -> `V1 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
101 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
102 $ ( falist_release LIST ) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
103 ERROR: object `LIST' not created properly: token empty |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
104 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
105 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
106 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
107 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
108 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
109 Creation and Destruction with more Items |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
110 ======================================== |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
111 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
112 Create an alist with two items |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
113 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
114 $ falist_create LIST K1 V1 K2 V2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
115 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
116 DEBUG: alist `LIST' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
117 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
118 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
119 DEBUG: `K2' -> `V2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
120 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
121 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
122 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
123 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
124 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
125 Create with inverse insertion order |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
126 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
127 $ falist_create LIST K2 V2 K1 V1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
128 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
129 DEBUG: alist `LIST' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
130 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
131 DEBUG: `K2' -> `V2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
132 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
133 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
134 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
135 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
136 Insert at the beginning |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
137 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
138 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
139 $ falist_create LIST K2 V2 K1 V1 K0 V0 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
140 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
141 DEBUG: alist `LIST' has length 3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
142 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
143 DEBUG: `K2' -> `V2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
144 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
145 DEBUG: `K0' -> `V0' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
146 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
147 Replace: beginning |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
148 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
149 $ falist_set $LIST K2 $'V2 \' \\ "$abc' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
150 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
151 DEBUG: alist `LIST' has length 3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
152 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
153 DEBUG: `K2' -> `V2 ' \ "$abc' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
154 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
155 DEBUG: `K0' -> `V0' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
156 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
157 Replace: mid |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
158 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
159 $ falist_set $LIST K1 'V1 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
160 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
161 DEBUG: alist `LIST' has length 3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
162 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
163 DEBUG: `K2' -> `V2 ' \ "$abc' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
164 DEBUG: `K1' -> `V1 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
165 DEBUG: `K0' -> `V0' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
166 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
167 Replace: end |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
168 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
169 $ falist_set $LIST K0 'V0 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
170 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
171 DEBUG: alist `LIST' has length 3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
172 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
173 DEBUG: `K2' -> `V2 ' \ "$abc' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
174 DEBUG: `K1' -> `V1 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
175 DEBUG: `K0' -> `V0 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
176 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
177 Insert in the midele again |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
178 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
179 $ falist_set LIST K1-1 'V1-1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
180 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
181 DEBUG: alist `LIST' has length 4 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
182 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
183 DEBUG: `K2' -> `V2 ' \ "$abc' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
184 DEBUG: `K1' -> `V1 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
185 DEBUG: `K0' -> `V0 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
186 DEBUG: `K1-1' -> `V1-1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
187 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
188 Clear resets to initial values |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
189 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
190 $ falist_clear LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
191 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
192 _farr_KV_[a-f0-9]+_B=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
193 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
194 _farr_KV_[a-f0-9]+_P='0;0' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
195 _farr_KV_[a-f0-9]+__=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
196 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
197 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
198 $ falist_print_length LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
199 0 (no-eol) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
200 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
201 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
202 |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
203 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
204 Clear |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
205 ===== |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
206 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
207 $ falist_create LIST |
|
651
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
208 $ falist_istrue LIST |
|
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
209 [1] |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
210 $ falist_set LIST K2 V2 |
|
651
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
211 $ falist_istrue LIST |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
212 $ falist_set LIST K1 V1 |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
213 $ falist_debug LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
214 DEBUG: alist `LIST' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
215 DEBUG: the items: |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
216 DEBUG: `K2' -> `V2' |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
217 DEBUG: `K1' -> `V1' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
218 $ falist_length _i LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
219 $ echo "$_i" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
220 2 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
221 $ falist_print_length LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
222 2 (no-eol) |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
223 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
224 $ falist_clear LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
225 $ falist_length _i LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
226 $ echo "$_i" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
227 0 |
|
651
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
228 $ falist_istrue LIST |
|
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
229 [1] |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
230 $ falist_print_length LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
231 0 (no-eol) |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
232 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
233 Clear resets to initial values |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
234 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
235 $ falist_clear LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
236 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
237 _farr_KV_[a-f0-9]+_B=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
238 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
239 _farr_KV_[a-f0-9]+_P='0;0' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
240 _farr_KV_[a-f0-9]+__=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
241 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
242 $ falist_istrue LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
243 [1] |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
244 $ falist_release LIST |
|
651
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
245 $ falist_istrue LIST |
|
716
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
246 ERROR: object `LIST' not created properly: token empty |
|
651
57ee25cec0dd
farray.sh: farray_istrue() and falist_istrue(): truth tests for arrays and alists.
Franz Glasner <fzglas.hg@dom66.de>
parents:
615
diff
changeset
|
247 [1] |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
248 $ check_no_alist_artifacts |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
249 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
250 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
251 Optimized Adding |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
252 ================ |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
253 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
254 $ falist_create LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
255 $ falist_add LIST k1 v1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
256 $ falist_add LIST k2 v2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
257 Would violate order requirements |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
258 $ ( falist_add LIST k0 v0 ) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
259 ERROR: falist_add() would violate key order |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
260 [70] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
261 $ ( falist_add LIST k2 v2-2 ) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
262 ERROR: falist_add() would violate key order |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
263 [70] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
264 $ falist_add $LIST k3 $'" 111222333" \\\'444555666 ' # ' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
265 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
266 DEBUG: alist `LIST' has length 3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
267 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
268 DEBUG: `k1' -> `v1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
269 DEBUG: `k2' -> `v2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
270 DEBUG: `k3' -> `" 111222333" \'444555666 ' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
271 $ falist_add $LIST k4 'v4 1' k5 v5 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
272 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
273 DEBUG: alist `LIST' has length 5 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
274 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
275 DEBUG: `k1' -> `v1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
276 DEBUG: `k2' -> `v2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
277 DEBUG: `k3' -> `" 111222333" \'444555666 ' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
278 DEBUG: `k4' -> `v4 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
279 DEBUG: `k5' -> `v5' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
280 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
281 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
282 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
283 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
284 Iteration |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
285 ========= |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
286 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
287 $ falist_create LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
288 $ falist_set LIST K1 V1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
289 $ falist_set LIST K2 "V2 2" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
290 $ falist_set LIST K3 $'" 111222333" \\\'444555 ' # ' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
291 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
292 Consistency check of storage cookies |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
293 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
294 $ _c="$(falist_cookie_first LIST)" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
295 $ echo $_c |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
296 1/0;2@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
297 $ _cnull="$(falist_cookie_prev "${_c}")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
298 $ echo "${_cnull}" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
299 0/0;0@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
300 $ _c2="$(falist_cookie_next "$_c")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
301 $ echo "${_c2}" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
302 2/1;3@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
303 $ _c3="$(falist_cookie_prev "${_c2}")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
304 $ test "${_c}" = "${_c3}" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
305 $ _c=$(falist_cookie_last LIST) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
306 $ echo $_c |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
307 3/2;0@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
308 $ _cnull="$(falist_cookie_next "${_c}")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
309 $ echo "${_cnull}" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
310 0/0;0@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
311 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
312 MANUAL (by cookie, forward in insertion order) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
313 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
314 $ _pos="$(falist_cookie_first LIST)" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
315 > while falist_tryget_item_at _k _v "$_pos"; do |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
316 > printf $'%s -> `%s\'\\n' "$_k" "$_v" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
317 > _pos="$(falist_cookie_next "$_pos")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
318 > done |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
319 K1 -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
320 K2 -> `V2 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
321 K3 -> `" 111222333" \'444555 ' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
322 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
323 MANUAL (by cookie, reversed insertion order) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
324 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
325 $ _pos="$(falist_cookie_last LIST)" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
326 > while falist_tryget_item_at _k _v "$_pos"; do |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
327 > printf $'`%s\' <- %s\\n' "$_v" "$_k" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
328 > _pos="$(falist_cookie_prev "$_pos")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
329 > done |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
330 `" 111222333" \'444555 ' <- K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
331 `V2 2' <- K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
332 `V1' <- K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
333 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
334 MANUAL values (by cookie, forward in insertion order) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
335 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
336 $ _pos="$(falist_cookie_first LIST)" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
337 > while falist_tryget_value_at _v "$_pos"; do |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
338 > printf $'`%s\'\\n' "$_v" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
339 > _pos="$(falist_cookie_next "$_pos")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
340 > done |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
341 `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
342 `V2 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
343 `" 111222333" \'444555 ' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
344 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
345 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
346 MANUAL keys (by cookie, reversed insertion order) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
347 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
348 $ _pos="$(falist_cookie_last LIST)" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
349 > while falist_tryget_key_at _k "$_pos"; do |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
350 > printf '%s\n' "$_k" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
351 > _pos="$(falist_cookie_prev "$_pos")" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
352 > done |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
353 K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
354 K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
355 K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
356 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
357 ITERATE (for each, by name) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
358 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
359 $ falist_for_each LIST $'printf "EACH: %s key \\`%s\\\', value \\`%s\\\' at cookie %s\\n"' # ` |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
360 EACH: LIST key `K1', value `V1' at cookie 1/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
361 EACH: LIST key `K2', value `V2 2' at cookie 2/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
362 EACH: LIST key `K3', value `" 111222333" \\'444555 ' at cookie 3/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
363 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
364 ITERATE (for each, by value) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
365 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
366 $ falist_for_each "$LIST" $'printf "EACH: %s key \\`%s\\\', value \\`%s\\\' at cookie %s\\n"' # ` |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
367 EACH: _farr_KV\[\?,\?\]:[a-f0-9]+ key `K1', value `V1' at cookie 1/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
368 EACH: _farr_KV\[\?,\?\]:[a-f0-9]+ key `K2', value `V2 2' at cookie 2/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
369 EACH: _farr_KV\[\?,\?\]:[a-f0-9]+ key `K3', value `" 111222333" \\'444555 ' at cookie 3/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
370 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
371 $ falist_clear LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
372 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
373 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
374 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
375 ERROR: object `LIST' not created properly: token empty |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
376 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
377 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
378 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
379 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
380 Deleting |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
381 ======== |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
382 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
383 $ falist_create LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
384 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
385 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
386 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
387 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
388 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
389 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
390 $ falist_create LIST K1 V1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
391 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
392 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
393 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
394 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
395 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
396 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
397 $ falist_istrue LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
398 $ falist_trydel LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
399 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
400 DEBUG: alist `LIST' has length 0 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
401 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
402 _farr_KV_[a-f0-9]+_B=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
403 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
404 _farr_KV_[a-f0-9]+_P='0;0' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
405 _farr_KV_[a-f0-9]+__=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
406 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
407 $ (falist_istrue LIST) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
408 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
409 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
410 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
411 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
412 $ falist_create LIST K1 V1 K2 V2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
413 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
414 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
415 $ falist_trydel LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
416 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
417 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
418 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
419 DEBUG: `K2' -> `V2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
420 $ falist_trydel LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
421 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
422 DEBUG: alist `LIST' has length 0 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
423 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
424 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
425 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
426 $ falist_create LIST K1 V1 K2 V2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
427 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
428 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
429 $ falist_trydel LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
430 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
431 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
432 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
433 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
434 $ falist_trydel LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
435 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
436 DEBUG: alist `LIST' has length 0 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
437 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
438 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
439 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
440 $ falist_create LIST K1 V1 K2 V2 K3 V3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
441 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
442 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
443 $ falist_trydel LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
444 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
445 DEBUG: alist `LIST' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
446 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
447 DEBUG: `K2' -> `V2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
448 DEBUG: `K3' -> `V3' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
449 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
450 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
451 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
452 $ falist_create LIST K1 V1 K2 V2 K3 V3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
453 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
454 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
455 $ falist_trydel LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
456 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
457 DEBUG: alist `LIST' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
458 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
459 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
460 DEBUG: `K3' -> `V3' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
461 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
462 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
463 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
464 $ falist_create LIST K1 V1 K2 V2 K3 V3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
465 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
466 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
467 $ falist_trydel LIST K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
468 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
469 DEBUG: alist `LIST' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
470 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
471 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
472 DEBUG: `K2' -> `V2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
473 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
474 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
475 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
476 $ falist_create LIST K1 V1 K2 V2 K3 V3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
477 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
478 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
479 $ falist_trydel LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
480 $ falist_trydel LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
481 $ falist_trydel LIST K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
482 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
483 DEBUG: alist `LIST' has length 0 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
484 Check that the binary search list is cleaned up |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
485 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
486 _farr_KV_[a-f0-9]+_B=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
487 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
488 _farr_KV_[a-f0-9]+_P='0;0' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
489 _farr_KV_[a-f0-9]+__=0 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
490 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
491 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
492 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
493 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
494 $ falist_create LIST K1 V1 K2 V2 K3 V3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
495 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
496 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
497 $ falist_trydel LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
498 Skipping tombstones |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
499 $ (falist_trydel LIST K2) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
500 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
501 $ falist_trydel LIST K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
502 $ (falist_trydel LIST K3) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
503 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
504 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
505 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
506 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
507 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
508 Check that the binary search list is cleaned up properly: just the first |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
509 storage entries are left |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
510 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
511 _farr_KV_[a-f0-9]+_B=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
512 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
513 _farr_KV_[a-f0-9]+_P='1;1' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
514 _farr_KV_[a-f0-9]+__=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
515 _farr_Kb_[a-f0-9]+_1='1;V@K1' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
516 _farr_Ks_[a-f0-9]+_1='0;0@K1' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
517 _farr_Vs_[a-f0-9]+_1=V1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
518 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
519 Can re-add K2 now again |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
520 $ falist_add LIST K2 'V2 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
521 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
522 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
523 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
524 Try this with reversed insertion order also |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
525 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
526 $ falist_create LIST K3 V3 K2 V2 K1 V1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
527 $ falist_find _var LIST K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
528 Cookie has structure <storage-ptr>/<storage-prev-ptr>;<storage-next-ptr>@<object-token> |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
529 $ echo "$_var" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
530 1/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
531 $ falist_contains LIST K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
532 $ falist_find _var LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
533 $ echo "$_var" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
534 2/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
535 $ falist_contains LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
536 $ falist_find _var LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
537 $ echo "$_var" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
538 3/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
539 $ falist_contains LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
540 $ (falist_trydel LIST foo) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
541 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
542 $ falist_trydel LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
543 Skipping tombstones |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
544 $ (falist_trydel LIST K2) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
545 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
546 $ falist_trydel LIST K3 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
547 $ (falist_trydel LIST K3) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
548 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
549 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
550 DEBUG: alist `LIST' has length 1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
551 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
552 DEBUG: `K1' -> `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
553 Check that the binary search list is cleaned up properly: just the first |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
554 storage entries are left |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
555 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
556 _farr_KV_[a-f0-9]+_B=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
557 _farr_KV_[a-f0-9]+_C=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
558 _farr_KV_[a-f0-9]+_P='3;3' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
559 _farr_KV_[a-f0-9]+__=1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
560 _farr_Kb_[a-f0-9]+_1='3;V@K1' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
561 _farr_Ks_[a-f0-9]+_3='0;0@K1' (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
562 _farr_Vs_[a-f0-9]+_3=V1 (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
563 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
564 Can re-add K2 now again |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
565 $ falist_add LIST K2 'V2 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
566 $ falist_find _var LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
567 $ falist_contains LIST K2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
568 But K3 is tombstoned/deleted |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
569 $ (falist_find _var LIST K3) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
570 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
571 $ (falist_contains LIST K3) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
572 [1] |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
573 $ farray_create ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
574 $ falist_keys ARRAY LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
575 $ farray_debug ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
576 DEBUG: array `ARRAY' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
577 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
578 DEBUG: 1: `K1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
579 DEBUG: 2: `K2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
580 $ farray_release ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
581 $ farray_create ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
582 $ falist_values ARRAY LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
583 $ farray_debug ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
584 DEBUG: array `ARRAY' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
585 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
586 DEBUG: 1: `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
587 DEBUG: 2: `V2 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
588 $ farray_release ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
589 $ farray_create ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
590 $ falist_items ARRAY LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
591 $ farray_debug ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
592 DEBUG: array `ARRAY' has length 4 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
593 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
594 DEBUG: 1: `K1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
595 DEBUG: 2: `V1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
596 DEBUG: 3: `K2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
597 DEBUG: 4: `V2 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
598 $ farray_release ARRAY |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
599 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
600 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
601 $ check_no_array_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
602 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
603 |
|
745
a5918c859fe9
farray.sh: Implement falist_find() -- a variant of falist_contains() that also returns the found index proper
Franz Glasner <fzglas.hg@dom66.de>
parents:
743
diff
changeset
|
604 Get / Set / Contains / Find Index |
|
a5918c859fe9
farray.sh: Implement falist_find() -- a variant of falist_contains() that also returns the found index proper
Franz Glasner <fzglas.hg@dom66.de>
parents:
743
diff
changeset
|
605 ================================= |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
606 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
607 $ falist_create LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
608 $ falist_set LIST K1 V1 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
609 $ falist_set LIST K2 V2 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
610 $ falist_debug LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
611 DEBUG: alist `LIST' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
612 DEBUG: the items: |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
613 DEBUG: `K1' -> `V1' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
614 DEBUG: `K2' -> `V2' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
615 $ falist_length _i LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
616 $ echo "$_i" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
617 2 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
618 $ falist_print_length LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
619 2 (no-eol) |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
620 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
621 $ falist_set LIST K2 "V2 2" |
|
718
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
622 $ falist_set_unique LIST K2 "V2 duplicate" |
|
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
623 [1] |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
624 $ falist_set LIST K3 $'" 111222333" \\\'444555 ' # ' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
625 $ falist_debug LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
626 DEBUG: alist `LIST' has length 3 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
627 DEBUG: the items: |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
628 DEBUG: `K1' -> `V1' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
629 DEBUG: `K2' -> `V2 2' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
630 DEBUG: `K3' -> `" 111222333" \'444555 ' |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
631 $ falist_length _i LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
632 $ echo "$_i" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
633 3 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
634 $ falist_print_length LIST |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
635 3 (no-eol) |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
636 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
637 $ falist_contains LIST K1 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
638 $ falist_find cookie LIST K1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
639 $ echo "$cookie" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
640 1/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
641 $ falist_contains LIST K |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
642 [1] |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
643 $ falist_find cookie LIST K |
|
745
a5918c859fe9
farray.sh: Implement falist_find() -- a variant of falist_contains() that also returns the found index proper
Franz Glasner <fzglas.hg@dom66.de>
parents:
743
diff
changeset
|
644 [1] |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
645 $ falist_get _var LIST K2 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
646 $ echo "$_var" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
647 V2 2 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
648 $ falist_tryget _var LIST K1 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
649 $ echo "$_var" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
650 V1 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
651 $ falist_tryget _i LIST K |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
652 [1] |
|
746
7e2279d6db0f
farray.sh: falist_get() and falist_tryget() now optionally can store the index of the found item into a variable also
Franz Glasner <fzglas.hg@dom66.de>
parents:
745
diff
changeset
|
653 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
654 $ falist_get _var LIST K2 _cookie |
|
746
7e2279d6db0f
farray.sh: falist_get() and falist_tryget() now optionally can store the index of the found item into a variable also
Franz Glasner <fzglas.hg@dom66.de>
parents:
745
diff
changeset
|
655 $ echo "$_var" |
|
7e2279d6db0f
farray.sh: falist_get() and falist_tryget() now optionally can store the index of the found item into a variable also
Franz Glasner <fzglas.hg@dom66.de>
parents:
745
diff
changeset
|
656 V2 2 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
657 $ echo "$_cookie" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
658 2/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
659 $ falist_tryget _var LIST K1 _cookie |
|
746
7e2279d6db0f
farray.sh: falist_get() and falist_tryget() now optionally can store the index of the found item into a variable also
Franz Glasner <fzglas.hg@dom66.de>
parents:
745
diff
changeset
|
660 $ echo "$_var" |
|
7e2279d6db0f
farray.sh: falist_get() and falist_tryget() now optionally can store the index of the found item into a variable also
Franz Glasner <fzglas.hg@dom66.de>
parents:
745
diff
changeset
|
661 V1 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
662 $ echo "$_cookie" |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
663 1/[0-9]+;[0-9]+@[a-f0-9]+ (re) |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
664 $ falist_tryget _i LIST K _cookie |
|
746
7e2279d6db0f
farray.sh: falist_get() and falist_tryget() now optionally can store the index of the found item into a variable also
Franz Glasner <fzglas.hg@dom66.de>
parents:
745
diff
changeset
|
665 [1] |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
666 $ _var="$(falist_print_length NON_EXISTING_LIST)" |
|
716
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
667 ERROR: object `NON_EXISTING_LIST' not created properly: token empty |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
668 $ echo "${_var}" |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
669 -1 |
|
718
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
670 $ falist_set_unique LIST K4 "V4" |
|
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
671 $ falist_debug LIST |
|
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
672 DEBUG: alist `LIST' has length 4 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
673 DEBUG: the items: |
|
718
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
674 DEBUG: `K1' -> `V1' |
|
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
675 DEBUG: `K2' -> `V2 2' |
|
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
676 DEBUG: `K3' -> `" 111222333" \'444555 ' |
|
2502e077d5e9
farray.sh: Implement "falist_set_unique()" that does not overwrite existing key-value pairs
Franz Glasner <fzglas.hg@dom66.de>
parents:
717
diff
changeset
|
677 DEBUG: `K4' -> `V4' |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
678 $ falist_release LIST |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
679 $ check_no_alist_artifacts |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
680 |
|
751
4101e755b3e7
farray.sh: extra tests for falist_find/farray_find in empty collections
Franz Glasner <fzglas.hg@dom66.de>
parents:
746
diff
changeset
|
681 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
682 Items / Keys / Values |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
683 ===================== |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
684 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
685 $ farray_create KEYS |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
686 $ farray_create VALUES |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
687 $ farray_create ITEMS |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
688 $ falist_create LIST "Key 1" "Value 1" "Key 2" 'Value 2 '\''' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
689 $ falist_items ITEMS LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
690 $ farray_debug ITEMS |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
691 DEBUG: array `ITEMS' has length 4 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
692 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
693 DEBUG: 1: `Key 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
694 DEBUG: 2: `Value 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
695 DEBUG: 3: `Key 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
696 DEBUG: 4: `Value 2 '' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
697 $ falist_keys KEYS LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
698 $ farray_debug KEYS |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
699 DEBUG: array `KEYS' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
700 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
701 DEBUG: 1: `Key 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
702 DEBUG: 2: `Key 2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
703 $ falist_values VALUES LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
704 $ farray_debug VALUES |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
705 DEBUG: array `VALUES' has length 2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
706 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
707 DEBUG: 1: `Value 1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
708 DEBUG: 2: `Value 2 '' |
|
607
c450fd0eaddb
farray.sh: Generalized indices for falist_tryget_{item,key,value}_at_index()
Franz Glasner <fzglas.hg@dom66.de>
parents:
606
diff
changeset
|
709 |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
710 $ falist_release LIST |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
711 $ farray_release KEYS |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
712 $ farray_release VALUES |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
713 $ farray_release ITEMS |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
714 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
715 $ check_no_alist_artifacts |
|
612
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
716 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
717 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
718 Compare |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
719 ======= |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
720 |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
721 $ falist_create LIST1 K1 V1 K2 V2 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
722 $ falist_debug LIST1 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
723 DEBUG: alist `LIST1' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
724 DEBUG: the items: |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
725 DEBUG: `K1' -> `V1' |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
726 DEBUG: `K2' -> `V2' |
|
612
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
727 |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
728 $ falist_create LIST2 K2 V2 K1 V1 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
729 $ falist_debug LIST2 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
730 DEBUG: alist `LIST2' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
731 DEBUG: the items: |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
732 DEBUG: `K2' -> `V2' |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
733 DEBUG: `K1' -> `V1' |
|
612
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
734 |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
735 $ falist_create LIST3 K1 V1 K2 V2 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
736 $ falist_debug LIST3 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
737 DEBUG: alist `LIST3' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
738 DEBUG: the items: |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
739 DEBUG: `K1' -> `V1' |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
740 DEBUG: `K2' -> `V2' |
|
612
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
741 |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
742 $ falist_create LIST4 K1 V1 K2 V2-4 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
743 $ falist_debug LIST4 |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
744 DEBUG: alist `LIST4' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
745 DEBUG: the items: |
|
613
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
746 DEBUG: `K1' -> `V1' |
|
17194ffe3638
farray.sh: falist_create() and falist_set() now accept a sequence of key-value pairs.
Franz Glasner <fzglas.hg@dom66.de>
parents:
612
diff
changeset
|
747 DEBUG: `K2' -> `V2-4' |
|
612
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
748 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
749 $ falist_are_equal LIST1 LIST2 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
750 $ falist_are_equal LIST1 LIST4 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
751 [1] |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
752 $ falist_are_equal_with_order LIST1 LIST2 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
753 [1] |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
754 $ falist_are_equal_with_order LIST1 LIST3 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
755 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
756 $ falist_clear LIST2 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
757 $ falist_are_equal LIST1 LIST2 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
758 [1] |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
759 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
760 $ falist_clear LIST3 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
761 $ falist_are_equal_with_order LIST2 LIST3 |
|
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
762 |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
763 $ falist_release LIST1 |
|
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
764 $ falist_release LIST2 |
|
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
765 $ falist_release LIST3 |
|
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
766 $ falist_release LIST4 |
|
612
c9ef2339618d
farray.sh: Implemented comparison (ordered and unordered) for alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
607
diff
changeset
|
767 |
|
614
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
768 $ check_no_alist_artifacts |
|
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
769 |
|
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
770 |
|
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
771 Updating |
|
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
772 ======== |
|
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
773 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
774 Just replace existing items |
|
614
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
775 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
776 $ falist_create LIST k2 v2 k4 v4 k6 v6 k8 v8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
777 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
778 DEBUG: alist `LIST' has length 4 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
779 DEBUG: the items: |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
780 DEBUG: `k2' -> `v2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
781 DEBUG: `k4' -> `v4' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
782 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
783 DEBUG: `k8' -> `v8' |
|
614
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
784 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
785 $ falist_create UPDATE1 k2 v2-2 k4 v4-2 k8 v8-2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
786 $ falist_update LIST UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
787 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
788 DEBUG: alist `LIST' has length 4 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
789 DEBUG: the items: |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
790 DEBUG: `k2' -> `v2-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
791 DEBUG: `k4' -> `v4-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
792 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
793 DEBUG: `k8' -> `v8-2' |
|
614
62fbc4316d97
farray.sh: Implement falist_update(): update an existing alist from another
Franz Glasner <fzglas.hg@dom66.de>
parents:
613
diff
changeset
|
794 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
795 $ falist_release LIST |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
796 $ falist_release UPDATE1 |
|
615
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
797 $ check_no_alist_artifacts |
|
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
798 |
|
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
799 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
800 Handle previously deleted items also |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
801 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
802 $ falist_create LIST k2 v2 k4 v4 k6 v6 k8 v8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
803 $ falist_trydel LIST k2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
804 $ falist_create UPDATE1 k2 v2-2 k4 v4-2 k8 v8-2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
805 $ falist_update LIST UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
806 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
807 DEBUG: alist `LIST' has length 4 |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
808 DEBUG: the items: |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
809 DEBUG: `k4' -> `v4-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
810 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
811 DEBUG: `k8' -> `v8-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
812 DEBUG: `k2' -> `v2-2' |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
813 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
814 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
815 $ falist_release UPDATE1 |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
816 $ check_no_alist_artifacts |
|
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
817 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
818 $ falist_create LIST k2 v2 k4 v4 k6 v6 k8 v8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
819 $ falist_trydel LIST k4 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
820 $ falist_create UPDATE1 k2 v2-2 k4 v4-2 k8 v8-2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
821 $ falist_update LIST UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
822 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
823 DEBUG: alist `LIST' has length 4 |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
824 DEBUG: the items: |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
825 DEBUG: `k2' -> `v2-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
826 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
827 DEBUG: `k8' -> `v8-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
828 DEBUG: `k4' -> `v4-2' |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
829 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
830 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
831 $ falist_release UPDATE1 |
|
743
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
832 $ check_no_alist_artifacts |
|
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
833 |
|
6fcf7da87981
farray.sh: implement "falist_merge()" to merge two "sorted" alists and add the result to a resulting alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
739
diff
changeset
|
834 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
835 Just appending |
|
615
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
836 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
837 $ falist_create LIST k2 v2 k4 v4 k6 v6 k8 v8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
838 $ falist_create UPDATE1 k9 v9 k91 v91 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
839 $ falist_update LIST UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
840 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
841 DEBUG: alist `LIST' has length 6 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
842 DEBUG: the items: |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
843 DEBUG: `k2' -> `v2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
844 DEBUG: `k4' -> `v4' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
845 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
846 DEBUG: `k8' -> `v8' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
847 DEBUG: `k9' -> `v9' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
848 DEBUG: `k91' -> `v91' |
|
615
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
849 |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
850 $ falist_release LIST |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
851 $ falist_release UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
852 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
853 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
854 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
855 Append after deletion |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
856 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
857 $ falist_create LIST k2 v2 k4 v4 k6 v6 k8 v8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
858 $ falist_trydel LIST k8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
859 $ falist_create UPDATE1 k2 v2-2 k4 v4-2 k8 v8-2 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
860 $ falist_update LIST UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
861 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
862 DEBUG: alist `LIST' has length 4 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
863 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
864 DEBUG: `k2' -> `v2-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
865 DEBUG: `k4' -> `v4-2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
866 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
867 DEBUG: `k8' -> `v8-2' |
|
615
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
868 |
|
756
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
869 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
870 $ falist_release UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
871 $ check_no_alist_artifacts |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
872 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
873 Insertions |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
874 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
875 $ falist_create LIST k2 v2 k4 v4 k6 v6 k8 v8 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
876 $ falist_create UPDATE1 k1 v1 k3 v3 k7 v7 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
877 $ falist_update LIST UPDATE1 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
878 $ falist_debug LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
879 DEBUG: alist `LIST' has length 7 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
880 DEBUG: the items: |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
881 DEBUG: `k2' -> `v2' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
882 DEBUG: `k4' -> `v4' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
883 DEBUG: `k6' -> `v6' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
884 DEBUG: `k8' -> `v8' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
885 DEBUG: `k1' -> `v1' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
886 DEBUG: `k3' -> `v3' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
887 DEBUG: `k7' -> `v7' |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
888 |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
889 $ falist_release LIST |
|
33df05108ba1
farray.sh: New implementation alists: searching is done using a binary search now while preserving insertion order.
Franz Glasner <fzglas.hg@dom66.de>
parents:
751
diff
changeset
|
890 $ falist_release UPDATE1 |
|
615
454ce7fa25c8
farray.sh: Implement falist_items(), falist_keys() and falist_values()
Franz Glasner <fzglas.hg@dom66.de>
parents:
614
diff
changeset
|
891 $ check_no_alist_artifacts |
|
716
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
892 |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
893 |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
894 Cross Type Checks |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
895 ================= |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
896 |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
897 $ falist_create LIST |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
898 $ (farray_append LIST value) |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
899 ERROR: object `LIST' is not an array |
|
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
900 [70] |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
901 $ falist_release LIST |
|
716
36d953791e0c
farray.sh: The token values are prepended by a type-specific prefix: can now easily determine whether it is an array or alist from the value in its name
Franz Glasner <fzglas.hg@dom66.de>
parents:
651
diff
changeset
|
902 $ check_no_alist_artifacts |
|
717
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
903 |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
904 |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
905 Other Type Checks |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
906 ================= |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
907 |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
908 $ falist_type |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
909 unknown (no-eol) |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
910 $ falist_type __UNKNOWN_VARIABLE__ |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
911 unknown (no-eol) |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
912 $ testvar='foo' |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
913 $ falist_type testvar |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
914 value (no-eol) |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
915 $ testvar='' |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
916 $ falist_type testvar |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
917 null (no-eol) |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
918 $ falist_isalist testvar |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
919 [1] |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
920 $ falist_create LIST |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
921 $ falist_type LIST |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
922 alist (no-eol) |
|
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
923 $ falist_isalist LIST |
|
769
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
924 |
|
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
925 $ falist_isref "$LIST" |
|
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
926 $ falist_isref LIST |
|
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
927 [1] |
|
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
928 $ falist_isref '' |
|
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
929 [1] |
|
03350d2a2af6
farray.sh: Add public functions to check whether a given value refers to a object (array, alist).
Franz Glasner <fzglas.hg@dom66.de>
parents:
758
diff
changeset
|
930 |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
931 $ falist_release LIST |
|
717
f4725ad5cd21
farray.sh: type tests for array and alist
Franz Glasner <fzglas.hg@dom66.de>
parents:
716
diff
changeset
|
932 $ check_no_alist_artifacts |
|
719
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
933 |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
934 |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
935 Generic Destruction |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
936 =================== |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
937 |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
938 $ falist_create LIST k1 v2 |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
939 $ falist_debug LIST |
|
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
940 DEBUG: alist `LIST' has length 1 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
941 DEBUG: the items: |
|
719
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
942 DEBUG: `k1' -> `v2' |
|
728
858f4208d9cb
farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents:
726
diff
changeset
|
943 $ _farr_release_object "$LIST" |
|
719
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
944 $ check_no_alist_artifacts |
|
728
858f4208d9cb
farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents:
726
diff
changeset
|
945 $ (_farr_release_object "$LIST") |
|
729
05a325c7d5c5
farray.sh: change token prefixes again
Franz Glasner <fzglas.hg@dom66.de>
parents:
728
diff
changeset
|
946 ERROR: falist `_farr_KV\[\?,\?\]:([a-f0-9]+)' not created properly: no object for token `\1' (re) |
|
728
858f4208d9cb
farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents:
726
diff
changeset
|
947 [1] |
|
719
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
948 $ LIST='' |
|
728
858f4208d9cb
farray.sh: Resource management by reference counting done
Franz Glasner <fzglas.hg@dom66.de>
parents:
726
diff
changeset
|
949 $ _farr_release_object "$LIST" |
|
719
b2757e72b517
farray.sh: The first preparations to allow arrays/alists as values in other arrays or alists
Franz Glasner <fzglas.hg@dom66.de>
parents:
718
diff
changeset
|
950 $ check_no_alist_artifacts |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
951 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
952 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
953 Complex Debug |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
954 ============= |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
955 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
956 $ falist_create LIST |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
957 $ falist_set LIST K1 V1 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
958 $ falist_create ITEM1 K11 V11 K22 V22 |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
959 $ falist_set LIST 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:
729
diff
changeset
|
960 $ falist_release ITEM1 |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
961 $ falist_debug LIST |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
962 DEBUG: alist `LIST' has length 2 |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
963 DEBUG: the items: |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
964 DEBUG: `K1' -> `V1' |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
965 DEBUG: `K2' -> >>> |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
966 DEBUG: alist with token `[a-f0-9]+' has length 2 (re) |
|
733
772e4999562b
farray.sh: Unified the output of farray_debug() and falist_debug()
Franz Glasner <fzglas.hg@dom66.de>
parents:
730
diff
changeset
|
967 DEBUG: the items: |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
968 DEBUG: `K11' -> `V11' |
|
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
969 DEBUG: `K22' -> `V22' |
|
730
8f1583faf9ea
farray.sh: Rename farray_destroy() to farray_release() and falist_destroy() to falist_release()
Franz Glasner <fzglas.hg@dom66.de>
parents:
729
diff
changeset
|
970 $ falist_release LIST |
|
726
23f6d2993fa2
farray.sh: Test the debug output and the destruction of complex objects.
Franz Glasner <fzglas.hg@dom66.de>
parents:
724
diff
changeset
|
971 $ check_no_alist_artifacts |
|
758
7ead30e3b2f9
farray.sh: Check for typos in local variable names or missing "local" declarations for variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
756
diff
changeset
|
972 |
|
7ead30e3b2f9
farray.sh: Check for typos in local variable names or missing "local" declarations for variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
756
diff
changeset
|
973 |
|
7ead30e3b2f9
farray.sh: Check for typos in local variable names or missing "local" declarations for variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
756
diff
changeset
|
974 No Locals |
|
7ead30e3b2f9
farray.sh: Check for typos in local variable names or missing "local" declarations for variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
756
diff
changeset
|
975 ========= |
|
7ead30e3b2f9
farray.sh: Check for typos in local variable names or missing "local" declarations for variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
756
diff
changeset
|
976 |
|
7ead30e3b2f9
farray.sh: Check for typos in local variable names or missing "local" declarations for variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
756
diff
changeset
|
977 $ check_no_local_artifacts |
