diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-25 14:38:04 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-25 14:38:04 -0500 |
| commit | 4fc026a7270501d3c13ac267f6408b69c03d789c (patch) | |
| tree | a2631650b810dec43bf9272bee5cc684acd2a3a5 /test | |
| parent | d06c63c70c67af6db46cd2a1e3ed002e4b280a8b (diff) | |
Add tests for '#' on collections
Diffstat (limited to 'test')
| -rw-r--r-- | test/arrays.tm | 3 | ||||
| -rw-r--r-- | test/tables.tm | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/arrays.tm b/test/arrays.tm index 5484d5e2..8e30868c 100644 --- a/test/arrays.tm +++ b/test/arrays.tm @@ -9,6 +9,9 @@ >> arr[-1] = 30 +>> #arr += 3 + sum := 0 for x in arr sum += x diff --git a/test/tables.tm b/test/tables.tm index 5b53fc80..2e7c4798 100644 --- a/test/tables.tm +++ b/test/tables.tm @@ -1,12 +1,16 @@ >> t := {"one"=>1, "two"=>2; default=999} = {"one"=>1, "two"=>2; default=999} + >> t["one"] = 1 >> t["two"] = 2 >> t["???"] = 999 + +>> #t += 2 >> t.default = ?(readonly)999 >> t.fallback @@ -19,12 +23,16 @@ >> t2 := {"three"=>3; fallback=t} = {"three"=>3; fallback={"one"=>1, "two"=>2; default=999}} + >> t2["one"] = 1 >> t2["three"] = 3 >> t2["???"] = 999 + +>> #t2 += 1 >> t2.default = !Int64 >> t2.fallback |
