Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison tests/farray-object.t @ 728:858f4208d9cb
farray.sh: Resource management by reference counting done
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 07 Oct 2024 12:36:18 +0200 |
| parents | 23f6d2993fa2 |
| children | 8f1583faf9ea |
comparison
equal
deleted
inserted
replaced
| 727:35c29e9919ba | 728:858f4208d9cb |
|---|---|
| 15 Array | 15 Array |
| 16 ===== | 16 ===== |
| 17 | 17 |
| 18 $ farray_create ARRAY1 i1 i2 | 18 $ farray_create ARRAY1 i1 i2 |
| 19 $ farray_create ITEM1 i11 i22 | 19 $ farray_create ITEM1 i11 i22 |
| 20 This also transfers ownership | |
| 21 $ farray_append ARRAY1 "$ITEM1" | 20 $ farray_append ARRAY1 "$ITEM1" |
| 22 $ ITEM1='' | 21 $ farray_destroy ITEM1 |
| 23 $ falist_create LIST2 k1 v1 k2 v2 k3 v3 | 22 $ falist_create LIST2 k1 v1 k2 v2 k3 v3 |
| 24 This also transfers ownership | 23 This also transfers ownership |
| 25 $ farray_append ARRAY1 "$LIST2" | 24 $ farray_append ARRAY1 "$LIST2" |
| 26 $ LIST2='' | 25 $ falist_destroy LIST2 |
| 27 $ farray_debug ARRAY1 | 26 $ farray_debug ARRAY1 |
| 28 DEBUG: array `ARRAY1' has length 4 | 27 DEBUG: array `ARRAY1' has length 4 |
| 29 DEBUG: its contents: | 28 DEBUG: its contents: |
| 30 DEBUG: 1: `i1' | 29 DEBUG: 1: `i1' |
| 31 DEBUG: 2: `i2' | 30 DEBUG: 2: `i2' |
| 47 AList | 46 AList |
| 48 ===== | 47 ===== |
| 49 | 48 |
| 50 $ falist_create LIST1 k1 v1 | 49 $ falist_create LIST1 k1 v1 |
| 51 $ falist_create ITEM1 k11 v11 k22 v22 k33 v33 k44 v44 | 50 $ falist_create ITEM1 k11 v11 k22 v22 k33 v33 k44 v44 |
| 52 This also transfers ownership | |
| 53 $ falist_set LIST1 k2 "$ITEM1" | 51 $ falist_set LIST1 k2 "$ITEM1" |
| 54 $ ITEM1='' | 52 $ falist_destroy ITEM1 |
| 55 $ farray_create ARRAY2 a1 a2 a3 | 53 $ farray_create ARRAY2 a1 a2 a3 |
| 56 This also transfers ownership | |
| 57 $ falist_set LIST1 k3 "$ARRAY2" | 54 $ falist_set LIST1 k3 "$ARRAY2" |
| 58 $ ARRAY2='' | 55 $ farray_destroy ARRAY2 |
| 59 $ falist_debug LIST1 | 56 $ falist_debug LIST1 |
| 60 DEBUG: alist `LIST1' has length 3 | 57 DEBUG: alist `LIST1' has length 3 |
| 61 DEBUG: `k1' -> `v1' | 58 DEBUG: `k1' -> `v1' |
| 62 DEBUG: `k2': --> | 59 DEBUG: `k2': --> |
| 63 DEBUG: alist with token `[a-f0-9]+' has length 4 (re) | 60 DEBUG: alist with token `[a-f0-9]+' has length 4 (re) |
