# How many tests
BEGIN { print "1..3\n"; }
-# Our object.
-my $tr = SQL::Translator->new(parser => "MySQL", producer => "Oracle");
+# Our object; uses the default parser and producer
+my $tr = SQL::Translator->new;
# The filename, holder for all the data, and the filehandle
my $datafile = "t/data/mysql/Apache-Session-MySQL.sql";
# Pass filename: simplest way
my $translated_datafile = $tr->translate($datafile);
-print "Data from filename method is\n$translated_datafile\n\n\n";
+warn "Data from filename method is\n$translated_datafile\n\n\n";
# Pass string reference
read($fh, $data, -s $datafile);
my $translated_data = $tr->translate(\$data);
-print "Data from string is\n$translated_data\n\n\n";
+warn "Data from string is\n$translated_data\n\n\n";
# Pass IO::File instance
$fh->setpos(0);
my $translated_fh = $tr->translate($fh);
-print "Data from filehandle method is\n$translated_fh\n\n\n";
+warn "Data from filehandle method is\n$translated_fh\n\n\n";
# With all that setup out of the way, we can perform the actual tests.
# We need to test the equality of:
print "not " unless ($translated_data eq $translated_fh);
print "ok 3 # from string == from filehandle\n";
-#
-# Problem with SQL::Translator::Producer::Oracle: it is keeping track of
-# the last sequence number used, so as not to duplicate them, which
-# is reasonable. However on runs past the first, it seems to be
-# creating multiple constraint lines, that look like:
-#
-# CONSTRAINT i_sessions_pk_2 PRIMARY KEY (id),
-# CONSTRAINT i_sessions_pk_3 PRIMARY KEY (id)
-#
-# Dunno why.
# For this test, we should devise some other sort of output routine,
# that can take a data structure and output it in a reasonable -- and
-# machine parsable! -- way. The tendency of ::Producer::Oracle to
-# produce numerically incrementing constraints is fine, and is not a
-# bug, but it makes this test fail. (The duplicate CONSTRAINT *is* a
-# bug, though.)
+# machine parsable! -- way.