diff options
Diffstat (limited to 'tests/async/t7985.nim')
-rw-r--r-- | tests/async/t7985.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/async/t7985.nim b/tests/async/t7985.nim new file mode 100644 index 000000000..0365499d3 --- /dev/null +++ b/tests/async/t7985.nim @@ -0,0 +1,19 @@ +discard """ + file: "t7985.nim" + exitcode: 0 + output: "(value: 1)" +""" +import json, asyncdispatch + +proc getData(): Future[JsonNode] {.async.} = + result = %*{"value": 1} + +type + MyData = object + value: BiggestInt + +proc main() {.async.} = + let data = to(await(getData()), MyData) + echo data + +waitFor(main()) |