Add tests for '#' on collections

This commit is contained in:
Bruce Hill 2024-02-25 14:38:04 -05:00
parent d06c63c70c
commit 4fc026a727
2 changed files with 11 additions and 0 deletions

View File

@ -9,6 +9,9 @@
>> arr[-1]
= 30
>> #arr
= 3
sum := 0
for x in arr
sum += x

View File

@ -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