4 # Before `make install' is performed this script should be runnable with
5 # `make test'. After `make install' it should work as `perl test.pl'
10 use Test::SQL::Translator qw(maybe_plan);
14 BEGIN { map { $opt{$_}=1 if s/^-// } @ARGV; }
15 use constant DEBUG => (exists $opt{d} ? 1 : 0);
20 #=============================================================================
23 maybe_plan(3, 'Template', 'Test::Differences')
25 use Test::Differences;
28 use SQL::Translator::Producer::TTSchema;
30 # Parse the test XML schema
32 $obj = SQL::Translator->new(
33 debug => DEBUG, #$opt{d},
36 from => "XML-SQLFairy",
37 filename => "$Bin/data/xml/schema-basic.xml",
40 ttfile => "$Bin/data/template/basic.tt",
44 lives_ok { $out = $obj->translate; } "Translate ran";
45 ok $out ne "" ,"Produced something!";
46 local $/ = undef; # slurp
47 eq_or_diff $out, <DATA> ,"Output looks right";
50 #print "Debug:", Dumper($obj) if DEBUG;
57 ==========================================================================
69 foreign_key_reference:
84 foreign_key_reference:
99 foreign_key_reference:
114 foreign_key_reference:
129 foreign_key_reference:
144 foreign_key_reference:
159 foreign_key_reference: