From 479163befe8bb539ba691b1ff6e0b6f455e4b26b Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 3 May 2024 16:00:44 +0200 Subject: test keys as well --- test/it_pipe.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') 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() -- cgit v1.2.3