File: 21-old-takeWhile.t

package info (click to toggle)
libperlude-perl 0.61-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 360 kB
  • sloc: perl: 903; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/perl
use 5.10.0;
use strict;
use warnings;
use Perlude;
use Test::More skip_all => 'this is not fixable';

my ( @input, $got, $expected );

my $doubles = sub {
    state $seed = 0;
    $seed+=2;
};

my @first  = fold takeWhile { $_ < 5 } $doubles;
is_deeply \@first, [2, 4];

$TODO = 'dolmen says this test is broken';

my ($next) = fold take 1, $doubles;
is $next, 6;