2 # Copyright (C) 2006-2009, Parrot Foundation.
7 use Test::More tests => 2;
9 my $pbcc = q{PBC_COMPAT};
10 croak "Cannot locate $pbcc: $!" unless (-f $pbcc);
14 open my $IN, '<', $pbcc or croak "Unable to open $pbcc for reading: $!";
15 while (my $l = <$IN>) {
17 next if $l =~ m/^(?:#|\s*$)/o;
18 push @malformed, $. unless $l =~ m/^([^\t]+)\t[^\t]+\t[^\t]+\t[^\t]+$/o;
20 push @badversion, $. unless $version =~ m/^\d+\.\d+$/o;
22 close $IN or croak "Unable to close $pbcc after reading: $!";
23 is( scalar( @malformed ), 0, "All records in $pbcc are properly formatted" )
24 or diag( "These lines in $pbcc are malformed: @malformed\n" );
25 is( scalar( @badversion ), 0, "All records in $pbcc have valid version numbers" )
26 or diag( "These lines in $pbcc have bad version numbers: @badversion\n" );
30 t/codingstd/pbc_compat.t - Enforce PBC_COMPAT's record format
34 % prove t/codingstd/pbc_compat.t
38 PBC_COMPAT records the history of changes to Parrot's bytecode format.
39 Entries in this file must, per specifications in the file itself, consist of
40 four hard-tab-delimited columns. The first of these columns is the bytecode
41 version number, which must be in C<N.N> format, where each C<N> increases
42 monotonically. This test file enforces this coding standard.
44 We assume that this file is run from the top-level directory of the Parrot
51 # cperl-indent-level: 4
54 # vim: expandtab shiftwidth=4: