#!/usr/bin/perl use strict; use warnings; use Test::More; BEGIN { use_ok('List::Gather::Simple') }; is_deeply [gather { take 1; take 2 }], [1,2], "double take"; is_deeply [gather { take for (1,2) }], [1,2], "take implicit argument"; is_deeply [gather { take for gather { take 1 } }], [1], "nested gather"; is_deeply [gather { @gathered = (1); take 2; push @gathered, 3; }], [1,2,3], "@gathered"; is_deeply [gather { @gathered = (1); take gather { @gathered = (0); }; take 2; push @gathered, 3; }], [1,0,2,3], "nested @gathered"; is_deeply [gather { take 1 }, @gathered], [1], "localized @gathered"; done_testing;