From: Rafael Kitover Date: Sat, 20 Mar 2010 05:02:32 +0000 (-0400) Subject: test float(x) type aliases in pg X-Git-Tag: 0.06000~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f30ddf1578c8c2995ee6bdd5286b1060a7a9b5ad;p=dbsrgits%2FDBIx-Class-Schema-Loader.git test float(x) type aliases in pg --- diff --git a/t/12pg_common.t b/t/12pg_common.t index b09d0c4..fb31fb7 100644 --- a/t/12pg_common.t +++ b/t/12pg_common.t @@ -70,6 +70,9 @@ my $tester = dbixcsl_common_tests->new( 'char(2)' => { size => 2, data_type => 'character' }, 'numeric(6, 3)' => { size => [6,3], data_type => 'numeric' }, 'decimal(6, 3)' => { size => [6,3], data_type => 'numeric' }, + 'float(24)' => { size => undef, data_type => 'real' }, + 'float(53)' => { size => undef, data_type => 'double precision' }, + 'float' => { size => undef, data_type => 'double precision' }, }, extra => { create => [ diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 44fbea3..8dff6ec 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -1543,6 +1543,8 @@ sub setup_data_type_tests { my $test_count = 0; + my %seen_col_names; + while (my ($col_def, $expected_info) = each %$types) { my $have_size = $col_def =~ /\(/ ? 1 : 0; @@ -1551,6 +1553,8 @@ sub setup_data_type_tests { my $col_name = $type_alias . ($have_size ? '_with_size' : ''); + $col_name .= $seen_col_names{$col_name} if $seen_col_names{$col_name}++; + $ddl .= " $col_name $col_def,\n"; $cols->{$col_name} = $expected_info;