[Koha-bugs] [Bug 14256] Tests for TestBuilder fail randomly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jun 3 09:58:16 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14256

--- Comment #12 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Comment on attachment 39789
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39789
Bug 14256: (followup) do not repeat existing values on primary columns

Review of attachment 39789:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14256&attachment=39789)
-----------------------------------------------------------------

::: t/lib/TestBuilder.pm
@@ +244,5 @@
> +        my $data_type = $col_info->{data_type};
> +        $data_type =~ s| |_|;
> +
> +        if ( any { $data_type eq $_ } (keys $gen_type) ) {
> +            my $value_ok = 'no';

A boolean would be enough.

@@ +249,5 @@
> +            while ( $value_ok eq 'no' ) {
> +                # generate value
> +                $col_value = $gen_type->{$data_type}->( $self, { info => $col_info } );
> +                # should value be unique?
> +                my $primary_names = $self->schema->source($source)->primary_columns();

What about unique keys?

@@ +250,5 @@
> +                # generate value
> +                $col_value = $gen_type->{$data_type}->( $self, { info => $col_info } );
> +                # should value be unique?
> +                my $primary_names = $self->schema->source($source)->primary_columns();
> +                if ( not ( any { $col_name eq $_ } $primary_names and

any takes a list in parameter, not a ref.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list