File: 23_iflatten.t

package info (click to toggle)
libiterator-simple-perl 0.07-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 180 kB
  • sloc: perl: 1,116; makefile: 2
file content (23 lines) | stat: -rwxr-xr-x 530 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use Test::More tests => 4;

use strict;
use warnings;

use Iterator::Simple qw(:all);

my $itr;

{
	my $aryiter = iter([ 'foo', 'bar', iter(['hoge','hage']), 1, 2]);
	$itr = iflatten $aryiter;
	ok is_iterator($itr), 'iflatten creation';
	is_deeply list($itr) => ['foo', 'bar','hoge','hage',1,2], 'iflatten result';
}

{
	my $ary = [ 'foo', 'bar', iter(['hoge','hage']), 1, 2];
	$itr = iflatten $ary;
	ok is_iterator($itr), 'iterable source';
	is_deeply list($itr) => ['foo', 'bar','hoge','hage',1,2], 'iterable source result';
}