### ----------------------------------------------------
### -- Pod::EOD
### -- Licenses: MIT
### -- Authors: Rob Hoelz, Raku Comunity
### -- File: t/01-basic.rakutest
### ----------------------------------------------------
use Test;
use Pod::EOD;

sub load-pod($code) {
    my $full-code = "$code\n\$=pod";
    EVAL $full-code;
}

my @features = (
    'sub example {}',
    'module My::Module {}',
);

plan 2 * @features;

for @features -> $feature {
    my $pod = load-pod(qq:to/CODE/);
    #| Example Feature!
    $feature

    =begin head1
    NAME
    Example
    =end head1

    CODE

    move-declarations-to-end($pod);

    isa-ok $pod[0], Pod::Heading, "rearrangement should be successful for feature '$feature'";
    isa-ok $pod[1], Pod::Block::Declarator, "rearrangement should be successful for feature '$feature'";
}

# vim: expandtab shiftwidth=4


