X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02mysql-parser.t;h=ab8711c589799fd44b3254b9d240c7d8121a866d;hb=9b0e2cdbf8f02bf4b331648cad547189d40b1377;hp=13d611dfebd774b1108d7fea19a3709f9bfa9359;hpb=deb9f57f38f0f84ebbe4567bb48c970c79ed38c3;p=dbsrgits%2FSQL-Translator-2.0-ish.git diff --git a/t/02mysql-parser.t b/t/02mysql-parser.t index 13d611d..ab8711c 100644 --- a/t/02mysql-parser.t +++ b/t/02mysql-parser.t @@ -196,7 +196,7 @@ use SQL::Translator::Constants qw(:sqlt_types :sqlt_constants); my $i3 = shift @indices; is( $i3->name, 'name_idx', 'Name is "name_idx"' ); is( $i3->type, NORMAL, 'Normal index' ); - is( join(',', $i3->fields ), 'name(10)', 'Index is on field "name(10)"' ); + is( join(',', $i3->fields ), 'name', 'Index is on field "name(10)"' ); ## FIX ME my @constraints = $table->get_constraints; is( scalar @constraints, 2, 'Right number of constraints (2)' ); @@ -246,13 +246,23 @@ use SQL::Translator::Constants qw(:sqlt_types :sqlt_constants); phone varchar(255), PRIMARY KEY (address_id) ) TYPE=INNODB; + + CREATE TABLE store ( + id int NOT NULL auto_increment, + name varchar(255) NOT NULL + ) TYPE=INNODB; + + CREATE TABLE order_status ( + id int NOT NULL, + status varchar(255) NOT NULL + ) TYPE=INNODB; ] ) or die $tr->error; my $schema = $tr->schema; is( $schema->is_valid, 1, 'Schema is valid' ); my @tables = $schema->get_tables; - is( scalar @tables, 2, 'Right number of tables (2)' ); + is( scalar @tables, 4, 'Right number of tables (4)' ); my $t1 = shift @tables; is( $t1->name, 'orders', 'Found "orders" table' ); @@ -841,3 +851,5 @@ ok ($@, 'Exception thrown on invalid version string'); is( $f3->default_value, "test single quotes escaped like you\\'re", "Single quote in default value is escaped properly" ); is( $f3->is_primary_key, 0, 'Field is not PK' ); } + +done_testing;