Bug 36190: Adjust the test
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
293d9c66ce
commit
f19c721171
1 changed files with 10 additions and 3 deletions
|
@ -39,7 +39,7 @@ for my $file ( @files ) {
|
|||
push @errors, sprintf "%s:%s", $file, join (",", @e) if @e;
|
||||
}
|
||||
|
||||
is( @errors, 0, "The <form> in the following files are missing it's corresponding op parameter (see bug 34478)" )
|
||||
is( @errors, 0, "The <form> in the following files are missing it's corresponding op parameter, or op does not start with 'cud-' (see bug 34478)" )
|
||||
or diag( Dumper @errors );
|
||||
|
||||
sub catch_missing_op {
|
||||
|
@ -48,7 +48,7 @@ sub catch_missing_op {
|
|||
my @lines = read_file($file);
|
||||
my @errors;
|
||||
return unless grep { $_ =~ m|<form| } @lines;
|
||||
my ( $in_form, $closed_form, $line_open_form, $has_op );
|
||||
my ( $in_form, $closed_form, $line_open_form, $has_op, $op_value );
|
||||
my $line_number = 0;
|
||||
for my $line (@lines) {
|
||||
$line_number++;
|
||||
|
@ -58,10 +58,17 @@ sub catch_missing_op {
|
|||
}
|
||||
if ( $in_form && $line =~ m{name="op"} ) {
|
||||
$has_op = 1;
|
||||
if ( $line =~ m{value="(.*)"} ) {
|
||||
$op_value = $1
|
||||
}
|
||||
}
|
||||
if ( $in_form && $line =~ m{</form} ) {
|
||||
$closed_form = 0;
|
||||
unless ($has_op) {
|
||||
if ($has_op) {
|
||||
unless ( $op_value =~ m{^cud-} ) {
|
||||
push @errors, $line_open_form;
|
||||
}
|
||||
} else {
|
||||
push @errors, $line_open_form;
|
||||
}
|
||||
$in_form = 0;
|
||||
|
|
Loading…
Reference in a new issue