summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2024-05-03 16:00:44 +0200
committerUrban Müller2024-05-03 16:00:44 +0200
commit479163befe8bb539ba691b1ff6e0b6f455e4b26b (patch)
tree814c767cca98359ec89a9ffbd654869cbb019032
parentb0cb04f0c22e2a72c62fd40daf1e989e88f86947 (diff)
downloaditools-479163befe8bb539ba691b1ff6e0b6f455e4b26b.tar.gz
itools-479163befe8bb539ba691b1ff6e0b6f455e4b26b.tar.bz2
itools-479163befe8bb539ba691b1ff6e0b6f455e4b26b.zip
test keys as well
-rwxr-xr-xtest/it_pipe.t8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/it_pipe.t b/test/it_pipe.t
index 72847d1..0a36d1c 100755
--- a/test/it_pipe.t
+++ b/test/it_pipe.t
@@ -11,10 +11,10 @@ is(it::pipe(['foo'])->lines(), ["foo"]);
foreach(it::pipe(['a','b','a']) as $i) $x1 .= $i;
is($x1, "aba");
-foreach(it::pipe(['a','b','a'])->filter(fn($x) => $x == 'a') as $i) $x2 .= $i;
-is($x2, "aa");
-foreach(it::pipe(['a','b','a'])->grep('a') as $i) $x3 .= $i;
-is($x3, "aa");
+foreach(it::pipe(['a','b','a'])->filter(fn($x) => $x == 'a') as $k => $v) $x2 .= "$k$v";
+is($x2, "0a1a");
+foreach(it::pipe(['a','b','a'])->grep('a') as $k => $v) $x3 .= "$k$v";
+is($x3, "0a1a");
# csv()