View | Details | Raw Unified | Return to bug 19759
Collapse All | Expand All

(-)a/t/db_dependent/TestBuilder.t (-1 / +4 lines)
Lines 85-91 subtest 'Build all sources' => sub { Link Here
85
85
86
86
87
subtest 'Test length of some generated fields' => sub {
87
subtest 'Test length of some generated fields' => sub {
88
    plan tests => 2;
88
    plan tests => 3;
89
89
90
    # Test the length of a returned character field
90
    # Test the length of a returned character field
91
    my $bookseller = $builder->build({ source  => 'Aqbookseller' });
91
    my $bookseller = $builder->build({ source  => 'Aqbookseller' });
Lines 94-99 subtest 'Test length of some generated fields' => sub { Link Here
94
        'The length for a generated string (phone) should not be zero' );
94
        'The length for a generated string (phone) should not be zero' );
95
    is( length( $bookseller->{phone} ) <= $max, 1,
95
    is( length( $bookseller->{phone} ) <= $max, 1,
96
        'Check maximum length for a generated string (phone)' );
96
        'Check maximum length for a generated string (phone)' );
97
98
    my $item = $builder->build({ source => 'Item' });
99
    is( $item->{replacementprice}, sprintf("%.2f", $item->{replacementprice}), "The number of decimals for floats should not be more than 2" );
97
};
100
};
98
101
99
102
(-)a/t/lib/TestBuilder.pm (-2 / +1 lines)
Lines 417-423 sub _gen_real { Link Here
417
    if( defined( $params->{info}->{size} ) ) {
417
    if( defined( $params->{info}->{size} ) ) {
418
        $max = 10 ** ($params->{info}->{size}->[0] - $params->{info}->{size}->[1]);
418
        $max = 10 ** ($params->{info}->{size}->[0] - $params->{info}->{size}->[1]);
419
    }
419
    }
420
    return rand($max) + 1;
420
    return sprintf("%.2f", rand($max)+1);
421
}
421
}
422
422
423
sub _gen_date {
423
sub _gen_date {
424
- 

Return to bug 19759