From: Darren Chamberlain Date: Mon, 18 Mar 2002 20:32:16 +0000 (+0000) Subject: Changed many assumptions about the test. X-Git-Tag: v0.01~58^2~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2df9c21c77de51262a3e4577e8b6dcd2c113d8eb;hp=efd497767718ecda0a6cfff222e994c30ad37b86;p=dbsrgits%2FSQL-Translator.git Changed many assumptions about the test. Uses the default parser and producer (which is a pass through) --- diff --git a/t/04file,fh,string.t b/t/04file,fh,string.t index ca768be..cce41fa 100644 --- a/t/04file,fh,string.t +++ b/t/04file,fh,string.t @@ -17,8 +17,8 @@ use SQL::Translator; # 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"; @@ -27,18 +27,18 @@ my $fh = IO::File->new($datafile); # 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: @@ -59,20 +59,7 @@ print "ok 2 # from file == from string\n"; 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.