summary refs log tree commit diff stats
path: root/tests/collections/tapply.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/collections/tapply.nim')
-rw-r--r--tests/collections/tapply.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/collections/tapply.nim b/tests/collections/tapply.nim
new file mode 100644
index 000000000..403321ce1
--- /dev/null
+++ b/tests/collections/tapply.nim
@@ -0,0 +1,7 @@
+import sequtils
+
+var x = @[1, 2, 3]
+x.apply(proc(x: var int) = x = x+10)
+x.apply(proc(x: int): int = x+100)
+x.applyIt(it+5000)
+doAssert x == @[5111, 5112, 5113]