X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02mysql-parser.t;h=183979551c00242b2cbc3e80106ee606ea8153ce;hb=90e373b0538a542ee08db83758ad69dcc71eb614;hp=7d3ba41c1fc918f22c878c4b40ed5b8708bb7377;hpb=1ea530d4f2822ce6f7c59e436664757c550f5f66;p=dbsrgits%2FSQL-Translator.git diff --git a/t/02mysql-parser.t b/t/02mysql-parser.t index 7d3ba41..1839795 100644 --- a/t/02mysql-parser.t +++ b/t/02mysql-parser.t @@ -4,10 +4,15 @@ use strict; -use Test::More tests => 180; +use Test::More; use SQL::Translator; -use SQL::Translator::Parser::MySQL qw(parse); use SQL::Translator::Schema::Constants; +use Test::SQL::Translator qw(maybe_plan); + +BEGIN { + maybe_plan(180, "SQL::Translator::Parser::MySQL"); + SQL::Translator::Parser::MySQL->import('parse'); +} { my $tr = SQL::Translator->new; @@ -38,7 +43,7 @@ use SQL::Translator::Schema::Constants; is( $f2->name, 'a_session', 'Second field name is "a_session"' ); is( $f2->data_type, 'text', 'Type is "text"' ); - is( $f2->size, 65000, 'Size is "65000"' ); + is( $f2->size, 65_535, 'Size is "65,535"' ); is( $f2->is_nullable, 1, 'Field can be null' ); is( $f2->default_value, undef, 'Default value is undefined' ); is( $f2->is_primary_key, 0, 'Field is not PK' ); @@ -226,7 +231,7 @@ use SQL::Translator::Schema::Constants; KEY (billing_address_id), KEY (shipping_address_id), KEY (member_id, store_id), - FOREIGN KEY (status) REFERENCES order_status(id), + FOREIGN KEY (status) REFERENCES order_status(id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (billing_address_id) REFERENCES address(address_id), FOREIGN KEY (shipping_address_id) REFERENCES address(address_id) ) TYPE=INNODB; @@ -375,7 +380,8 @@ use SQL::Translator::Schema::Constants; is( $c5->type, FOREIGN_KEY, 'Constraint is a FK' ); is( join(',', $c5->fields), 'store_id', 'Constraint is on "store_id"' ); is( $c5->reference_table, 'store', 'To table "store"' ); - is( join(',', $c5->reference_fields), '', 'No reference fields defined' ); + is( join(',', map { $_ || '' } $c5->reference_fields), '', + 'No reference fields defined' ); my $t2 = shift @tables; is( $t2->name, 'address', 'Found "address" table' );