summaryrefslogtreecommitdiff
path: root/tests/it.t
diff options
context:
space:
mode:
authorUrban Müller2016-08-26 15:30:40 +0200
committerUrban Müller2016-11-10 16:00:50 +0100
commit665cf76c34f910504705bbb24da1498709d69960 (patch)
tree2caf4bdbc8d708e94d9c93e17dacdd473f52ef7e /tests/it.t
parent52aa39b034da27fc758f0ae5a78c0b5ace05e295 (diff)
downloaditools-665cf76c34f910504705bbb24da1498709d69960.tar.gz
itools-665cf76c34f910504705bbb24da1498709d69960.tar.bz2
itools-665cf76c34f910504705bbb24da1498709d69960.zip
it:map(): allow any callable object (anon functions) or code in string
Diffstat (limited to 'tests/it.t')
-rwxr-xr-xtests/it.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/it.t b/tests/it.t
index 3688d2a..b193591 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -3,7 +3,6 @@
# Tests for it.class
-
#
# tests for it::match()
#
@@ -415,3 +414,7 @@ is(it::mod(-9, 4), 3);
is(it::mod(-8, 4), 0);
is(it::mod(0, 4), 0);
is(it::mod(7, 4), 3);
+
+is(it::map('5*$k+$v', array(1, 2)), array(1, 7));
+is(it::map(create_function('$k,$v', 'return 5*$k+$v;'), array(1, 2)), array(1, 7));
+is(it::map(function($k, $v) {return 5*$k+$v;}, array(1, 2)), array(1, 7));