comparison tests/farray-alist.t @ 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
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 04 Oct 2024 15:45:51 +0200
parents 57ee25cec0dd
children f4725ad5cd21
comparison
equal deleted inserted replaced
715:684bacac299c 716:36d953791e0c
30 $ falist_debug LIST 30 $ falist_debug LIST
31 DEBUG: alist `LIST' has length 0 31 DEBUG: alist `LIST' has length 0
32 32
33 $ falist_destroy LIST 33 $ falist_destroy LIST
34 $ ( falist_destroy LIST ) 34 $ ( falist_destroy LIST )
35 ERROR: falist `LIST' not created properly: token empty 35 ERROR: object `LIST' not created properly: token empty
36 [1] 36 [1]
37 37
38 $ check_no_alist_artifacts 38 $ check_no_alist_artifacts
39 39
40 40
66 $ falist_print_length LIST 66 $ falist_print_length LIST
67 0 (no-eol) 67 0 (no-eol)
68 68
69 $ falist_destroy LIST 69 $ falist_destroy LIST
70 $ falist_istrue LIST 70 $ falist_istrue LIST
71 ERROR: falist `LIST' not created properly: token empty 71 ERROR: object `LIST' not created properly: token empty
72 [1] 72 [1]
73 $ check_no_alist_artifacts 73 $ check_no_alist_artifacts
74 74
75 75
76 Get / Set / Contains 76 Get / Set / Contains
112 $ echo "$_var" 112 $ echo "$_var"
113 V1 113 V1
114 $ falist_tryget _i LIST K 114 $ falist_tryget _i LIST K
115 [1] 115 [1]
116 $ _var="$(falist_print_length NON_EXISTING_LIST)" 116 $ _var="$(falist_print_length NON_EXISTING_LIST)"
117 ERROR: falist `NON_EXISTING_LIST' not created properly: token empty 117 ERROR: object `NON_EXISTING_LIST' not created properly: token empty
118 $ echo "${_var}" 118 $ echo "${_var}"
119 -1 119 -1
120 120
121 $ falist_destroy LIST 121 $ falist_destroy LIST
122 $ check_no_alist_artifacts 122 $ check_no_alist_artifacts
164 EACH: LIST key `K3', value `" 111222333" \'444555 ' at idx 3 164 EACH: LIST key `K3', value `" 111222333" \'444555 ' at idx 3
165 165
166 $ falist_clear LIST 166 $ falist_clear LIST
167 $ falist_destroy LIST 167 $ falist_destroy LIST
168 $ falist_destroy LIST 168 $ falist_destroy LIST
169 ERROR: falist `LIST' not created properly: token empty 169 ERROR: object `LIST' not created properly: token empty
170 [1] 170 [1]
171 171
172 $ check_no_alist_artifacts 172 $ check_no_alist_artifacts
173 173
174 174
360 $ farray_destroy KEYS 360 $ farray_destroy KEYS
361 $ farray_destroy VALUES 361 $ farray_destroy VALUES
362 $ farray_destroy ITEMS 362 $ farray_destroy ITEMS
363 363
364 $ check_no_alist_artifacts 364 $ check_no_alist_artifacts
365 $ check_no_array_artifacts 365
366
367 Cross Type Checks
368 =================
369
370 $ falist_create LIST
371 $ (farray_append LIST value)
372 ERROR: object `LIST' is not an array
373 [70]
374 $ falist_destroy LIST
375 $ check_no_alist_artifacts