Skip to content

Commit

Permalink
Add three very basic function-call-via-path tests
Browse files Browse the repository at this point in the history
Partly inspired by the mis-review of CC#2226.
  • Loading branch information
earl committed Dec 15, 2015
1 parent 39486f5 commit e02f62c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions core-tests.r
Expand Up @@ -2487,6 +2487,25 @@
a-value: file://a
file://a/1 = a-value/1
]
; calling functions through paths: function in object
[
obj: make object! [fun: func [] [1]]
1 == obj/fun
]
[
obj: make object! [fun: func [/ref val] [val]]
1 == obj/fun/ref 1
]
; calling functions through paths: function in block, positional
[
blk: reduce [func [] [10] func [] [20]]
10 == blk/1
]
; calling functions through paths: function in block, "named"
[
blk: reduce ['foo func [] [10] 'bar func [] [20]]
20 == blk/bar
]
; bug#26
[
b: [b 1]
Expand Down

0 comments on commit e02f62c

Please sign in to comment.