summaryrefslogtreecommitdiff
path: root/test/it.t
diff options
context:
space:
mode:
Diffstat (limited to 'test/it.t')
-rwxr-xr-xtest/it.t3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/it.t b/test/it.t
index 0aee958..7733c00 100755
--- a/test/it.t
+++ b/test/it.t
@@ -490,6 +490,9 @@ is(it::map('it::ucfirst', ["aaa"]), ["Aaa"]);
$dom = new DOMDocument;
$dom->loadXML('<foo>42</foo>');
is(it::map('$v->C14N()', $dom->childNodes), [ '<foo>42</foo>' ], "Traversable: Needs copy, not modifiable in-place");
+# Generator function
+function _generator() { foreach (range(1,2) as $v) yield $v; }
+is(it::map('2*$v', _generator()), [2, 4], "Generator");
# Special values which are not callable
is(it::map('null', ["aaa", "aa"]), [null, null]);
is(it::map('1', ["aaa", "aa"]), [1, 1]);