diff options
author | Zahary Karadjov <zahary@gmail.com> | 2017-04-09 23:43:29 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2017-04-09 23:45:52 +0300 |
commit | 34b25274416431f713bc343bdab3cd04d273a419 (patch) | |
tree | 218f3d8e01be89a2b07af0c4062ebf2c97e4dae3 /tests/closure | |
parent | 48a1a54d1ca0f17676ddddbb10a48a5406319fe5 (diff) | |
download | Nim-34b25274416431f713bc343bdab3cd04d273a419.tar.gz |
the new blocks without 'do' produce compatible AST with 'do blocks'
Diffstat (limited to 'tests/closure')
-rw-r--r-- | tests/closure/tdonotation.nim | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/closure/tdonotation.nim b/tests/closure/tdonotation.nim index 795b18f86..5acb17da2 100644 --- a/tests/closure/tdonotation.nim +++ b/tests/closure/tdonotation.nim @@ -1,8 +1,10 @@ discard """ output: ''' click at 10,20 +lost focus 1 lost focus 2 registered handler for UserEvent 1 +registered handler for UserEvent 2 registered handler for UserEvent 3''' """ @@ -27,10 +29,8 @@ var b = Button() b.onClick do (e: Event): echo "click at ", e.x, ",", e.y -when false: - # this syntax doesn't work yet - b.onFocusLost: - echo "lost focus 1" +b.onFocusLost: + echo "lost focus 1" b.onFocusLost do: echo "lost focus 2" @@ -38,10 +38,8 @@ b.onFocusLost do: b.onUserEvent("UserEvent 1") do: discard -when false: - # this syntax doesn't work yet - b.onUserEvent("UserEvent 2"): - discard +b.onUserEvent("UserEvent 2"): + discard b.onUserEvent("UserEvent 3", () => echo "event 2") |