X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F33tt-table-producer.t;h=db87f830923dc9f6f627e1dfc283fdbf6c12e8e6;hb=6440741a562ff8bb42c79282d30f3562c4336578;hp=226679e5f67ba2b76f9cbe2f89f5e6cce3983a64;hpb=0be5b227cf41450dfbd47a634ace6efdd68b1d24;p=dbsrgits%2FSQL-Translator.git diff --git a/t/33tt-table-producer.t b/t/33tt-table-producer.t index 226679e..db87f83 100644 --- a/t/33tt-table-producer.t +++ b/t/33tt-table-producer.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w # vim:filetype=perl # Before `make install' is performed this script should be runnable with @@ -21,7 +21,7 @@ use File::Temp qw/tempdir/; #============================================================================= BEGIN { - maybe_plan(8, 'Template', 'Test::Differences') + maybe_plan(8, 'Template 2.20', 'Test::Differences') } use Test::Differences; @@ -55,7 +55,11 @@ warn $obj->error unless $out; # Normal output looks ok local $/ = undef; # slurp -eq_or_diff $out, ,"Output looks right"; +eq_or_diff + $out, + do { local (@ARGV, $/) = "$Bin/data/template/testresult_table.txt"; <> }, + "Output looks right" +; # File output my @files = glob("$tdir/*.txt"); @@ -66,33 +70,22 @@ is( $files[1], "$tdir/pet.txt" , "Wrote pet.txt" ); open(FILE, "$tdir/person.txt") || die "Couldn't open $tdir/person.txt : $!"; eq_or_diff , qq{Table: person Primary Key: person_id - Foriegn Keys: + Foreign Keys:\x20 Data Fields: name, age, weight, iq, description } , "person.txt looks right"; +close(FILE); open(FILE, "$tdir/pet.txt") || die "Couldn't open $tdir/pet.txt : $!"; eq_or_diff , qq{Table: pet Primary Key: pet_id, person_id - Foriegn Keys: + Foreign Keys:\x20 Data Fields: name, age } -, "person.txt looks right"; - +, "pet.txt looks right"; +close(FILE); print $out if DEBUG; #print "Debug:", Dumper($obj) if DEBUG; - -__DATA__ -Table: person - Primary Key: person_id - Foriegn Keys: - Data Fields: name, age, weight, iq, description - -Table: pet - Primary Key: pet_id, person_id - Foriegn Keys: - Data Fields: name, age -