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 (23 lines) | stat: -rw-r--r-- 366 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
22
23
#! /usr/bin/perl
use strict;
use warnings;
use Perlude::Lazy;
use Test::More;

plan tests => 2;


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

my $doubles = do {
    my $seed = 0;
    enlist { $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;