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);
16 #=============================================================================
21 'SQL::Translator::Parser::XML::SQLFairy',
26 use Test::Differences;
29 use SQL::Translator::Producer::TTSchema;
31 # Main test. Template whole schema and test tt_vars
34 $obj = SQL::Translator->new(
36 from => "XML-SQLFairy",
37 filename => "$Bin/data/xml/schema.xml",
40 ttfile => "$Bin/data/template/basic.tt",
48 lives_ok { $out = $obj->translate; } "Translate ran";
49 ok $out ne "" ,"Produced something!";
50 local $/ = undef; # slurp
51 eq_or_diff $out, <DATA> ,"Output looks right";
54 # Test passing of Template config
57 [%- FOREACH table = schema.get_tables %]
61 $obj = SQL::Translator->new(
63 from => "XML-SQLFairy",
64 filename => "$Bin/data/xml/schema.xml",
78 lives_ok { $out = $obj->translate; } "Translate ran";
79 ok $out ne "" ,"Produced something!";
80 local $/ = undef; # slurp
83 ,"Output looks right";
95 ==========================================================================
107 foreign_key_reference:
121 foreign_key_reference:
135 foreign_key_reference:
149 foreign_key_reference:
163 foreign_key_reference:
177 foreign_key_reference:
191 foreign_key_reference: