summary refs log tree commit diff stats
path: root/tests/closure
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2016-01-16 13:49:37 +0000
committerDominik Picheta <dominikpicheta@gmail.com>2016-01-16 13:49:37 +0000
commit40ae1ad3639040592877adf0b235e45d3b1785fd (patch)
tree8533aa1a1524b05d28b41c5d6471f7667db88cfc /tests/closure
parentb6e8a1437bf007aa9914f10a3f1c78b27b2a359d (diff)
downloadNim-40ae1ad3639040592877adf0b235e45d3b1785fd.tar.gz
Added test for #2138.
Diffstat (limited to 'tests/closure')
-rw-r--r--tests/closure/tfutclosure2138.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/closure/tfutclosure2138.nim b/tests/closure/tfutclosure2138.nim
new file mode 100644
index 000000000..e18834074
--- /dev/null
+++ b/tests/closure/tfutclosure2138.nim
@@ -0,0 +1,10 @@
+import future, sequtils
+
+proc any[T](list: varargs[T], pred: (T) -> bool): bool =
+    for item in list:
+        if pred(item):
+            result = true
+            break
+
+proc contains(s: string, words: varargs[string]): bool =
+  any(words, (word) => s.contains(word))
\ No newline at end of file