X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F18ttschema-producer.t;h=afe5025fc10e786f5b23a174761f89d2cc50bdf9;hb=2e11379ef0451e54acca5dee655b0c33272008ed;hp=5a927ed170005c6c9e18cd33e346599ccb7bfb8c;hpb=5952d39cc86d9478817d2716804f7fed41327a18;p=dbsrgits%2FSQL-Translator.git diff --git a/t/18ttschema-producer.t b/t/18ttschema-producer.t index 5a927ed..afe5025 100644 --- a/t/18ttschema-producer.t +++ b/t/18ttschema-producer.t @@ -4,11 +4,13 @@ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' +use strict; use Test::More; use Test::Exception; use Data::Dumper; -BEGIN { our %opt; map { $opt{$_}=1 if s/^-// } @ARGV; } +use vars '%opt'; +BEGIN { map { $opt{$_}=1 if s/^-// } @ARGV; } use constant DEBUG => (exists $opt{d} ? 1 : 0); local $SIG{__WARN__} = sub { diag "[warn] ", @_; }; @@ -32,12 +34,12 @@ use SQL::Translator; use SQL::Translator::Producer::TTSchema; # Parse the test XML schema -our $obj; +my $obj; $obj = SQL::Translator->new( debug => DEBUG, #$opt{d}, show_warnings => 1, add_drop_table => 1, - from => "SqlfXML", + from => "XML-SQLFairy", filename => "$Bin/data/xml/schema-basic.xml", to => "TTSchema", producer_args => { @@ -45,12 +47,12 @@ $obj = SQL::Translator->new( }, ); my $out; -lives_ok { $out = $obj->translate; } "Produced template"; -ok $out ne "" ,"Output has some content"; +lives_ok { $out = $obj->translate; } "Translate ran"; +ok $out ne "" ,"Produced something!"; local $/ = undef; # slurp eq_or_diff $out, ,"Output looks right"; -# I'm sure if this diff is the best test, it is probaly too sensitive. But it -# at least it will blow up if anything changes! +# I'm not sure if this diff is the best test, it is probaly too sensitive. But +# it at least it will blow up if anything changes! print $out if DEBUG; #print "Debug:", Dumper($obj) if DEBUG;