CodeGen-Protection

 view release on metacpan or  search on metacpan

t/lib/Test/CodeGen/Helpers.pm  view on Meta::CPAN

);

sub is_multiline_text ($$$) {
    my ( $text, $expected, $message ) = @_;
    local $Test::Builder::Level = $Test::Builder::Level + 1;
    my @text     = split /\n/ => $text;
    my @expected = split /\n/ => $expected;
    eq_or_diff \@text, \@expected, $message;
}

sub update_version ($) {
    my $text = shift;
    if ( $text =~ /\b(CodeGen::Protection::Format::\w+).*Checksum:/ ) {
        my $module     = $1;
        my $version_re = $module->_version_re;
        my $version    = $module->VERSION;
        $text =~ s/\b$module(\s+)$version_re\b/$module$1$version/g;
        return $text;
    }
    else {
        croak("Cannot find version in text:\n\n$text");



( run in 0.368 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )