Add tests for '#' on collections
This commit is contained in:
parent
d06c63c70c
commit
4fc026a727
@ -9,6 +9,9 @@
|
||||
>> arr[-1]
|
||||
= 30
|
||||
|
||||
>> #arr
|
||||
= 3
|
||||
|
||||
sum := 0
|
||||
for x in arr
|
||||
sum += x
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user