The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Errorchecks.t -- Tests to ensure MARC::Errorchecks subroutines work as expected. Currently, performs semi-random testing of some of the subroutines in MARC::Errorchecks.

TO DO

Devise checks for each subroutine individually.

UNIMPLEMENTED

#may add this section later

FROM_FILE: { my @expected = ( (undef) x $countofundefs, [ q{$tag: $error} ] );

        my $filename = "t/errorchecks.usmarc";

        my $file = MARC::File::USMARC->in( $filename );
        while ( my $marc = $file->next() ) {
                isa_ok( $marc, 'MARC::Record' );
                my $title = $marc->title;

        my $expected = shift @expected;
        my @warnings = ();
        push @warnings, (@{MARC::Errorchecks::check_all_subs($record)});

        if ( $expected ) {
                ok( eq_array( \@warnings, $expected ), "Warnings match on $title" );
                } 
        else {
                is( scalar @warnings, 0, "No warnings on $title" );
                }
        } # while

        is( scalar @expected, 0, "All expected messages have been exhausted." );
}

CURRENT SUBS

        push @errorstoreturn, (@{check_internal_spaces($marc)});

        push @errorstoreturn, (@{check_trailing_spaces($marc)});

        push @errorstoreturn, (@{check_double_periods($marc)});

        push @errorstoreturn, (@{check_008($marc)});

        push @errorstoreturn, (@{check_010($marc)});

        push @errorstoreturn, (@{check_end_punct_300($marc)});

        push @errorstoreturn, (@{check_bk008_vs_300($marc)});

        push @errorstoreturn, (@{check_490vs8xx($marc)});

        push @errorstoreturn, (@{check_240ind1vs1xx($marc)});

        push @errorstoreturn, (@{check_245ind1vs1xx($marc)});

        push @errorstoreturn, (@{matchpubdates($marc)});

        push @errorstoreturn, (@{check_bk008_vs_bibrefandindex($marc)});

        push @errorstoreturn, (@{check_041vs008lang($marc)});

        push @errorstoreturn, (@{check_5xxendingpunctuation($marc)});

        push @errorstoreturn, (@{findfloatinghyphens($marc)});

        push @errorstoreturn, (@{check_floating_punctuation($record)});

        push @errorstoreturn, (@{video007vs300vs538($marc)});

        push @errorstoreturn, (@{ldrvalidate($marc)});

        push @errorstoreturn, (@{geogsubjvs043($marc)});

        push @errorstoreturn, (@{findemptysubfields($marc)});

        push @errorstoreturn, (@{check_040present($marc)});

        push @errorstoreturn, (@{check_nonpunctendingfields($marc)});

        push @errorstoreturn, (@{check_fieldlength($marc)});