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 #=============================================================================
20 'SQL::Translator::Parser::XML::SQLFairy',
25 use Test::Differences;
28 use SQL::Translator::Producer::TTSchema;
30 # Main test. Template whole schema and test tt_vars
33 $obj = SQL::Translator->new(
35 from => "XML-SQLFairy",
36 filename => "$Bin/data/xml/schema.xml",
39 ttfile => "$Bin/data/template/basic.tt",
47 lives_ok { $out = $obj->translate; } "Translate ran";
48 ok $out ne "" ,"Produced something!";
51 do { local (@ARGV, $/) = "$Bin/data/template/testresult_basic.txt"; <> },
56 # Test passing of Template config
59 [%- FOREACH table = schema.get_tables %]
63 $obj = SQL::Translator->new(
65 from => "XML-SQLFairy",
66 filename => "$Bin/data/xml/schema.xml",
80 lives_ok { $out = $obj->translate; } "Translate ran";
81 ok $out ne "" ,"Produced something!";
82 local $/ = undef; # slurp
86 ,"Output looks right";