summary refs log tree commit diff stats
path: root/tests/varres/tvartup.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/varres/tvartup.nim')
-rw-r--r--tests/varres/tvartup.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/varres/tvartup.nim b/tests/varres/tvartup.nim
new file mode 100644
index 000000000..a8f15b232
--- /dev/null
+++ b/tests/varres/tvartup.nim
@@ -0,0 +1,10 @@
+discard """
+  output: "2 3"
+"""
+# Test the new tuple unpacking
+
+proc divmod(a, b: int): tuple[di, mo: int] =
+  return (a div b, a mod b)
+
+var (x, y) = divmod(15, 6)
+echo x, " ", y