X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F03mysql-to-oracle.t;h=664d4e9aa77dd5dcaf08078cfd4ef30b4dc601cf;hb=cb9bbc68fe26aa563d28d590221f6a0235b4062e;hp=0897878389eb13d806aedc0cfed321b8078c381f;hpb=b4bc8f6f6660b0a69cf2cd63959f65fd7a6e0ca0;p=dbsrgits%2FSQL-Translator.git diff --git a/t/03mysql-to-oracle.t b/t/03mysql-to-oracle.t index 0897878..664d4e9 100644 --- a/t/03mysql-to-oracle.t +++ b/t/03mysql-to-oracle.t @@ -2,8 +2,9 @@ # vim: set ft=perl: use strict; -use Test::More tests => 1; +use Test::More; use SQL::Translator; +use Test::SQL::Translator qw(maybe_plan); my $create = q| CREATE TABLE random ( @@ -11,12 +12,26 @@ CREATE TABLE random ( foo varchar(255) not null default '', updated timestamp ); +CREATE UNIQUE INDEX random_foo_update ON random(foo,updated); +CREATE INDEX random_foo ON random(foo); + |; +BEGIN { + maybe_plan(3, + 'SQL::Translator::Parser::MySQL', + 'SQL::Translator::Producer::Oracle'); +} + my $tr = SQL::Translator->new( parser => "MySQL", - producer => "Oracle" + producer => "Oracle", + quote_table_names => 0, + quote_field_names => 0, ); -ok( $tr->translate(\$create), 'Translate MySQL to Oracle' ); +my $output = $tr->translate(\$create); +ok( $output, 'Translate MySQL to Oracle' ); +ok( $output =~ /CREATE INDEX random_foo /, 'Normal index definition translated.'); +ok( $output =~ /CREATE UNIQUE INDEX random_foo_update /, 'Unique index definition translated.');