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);
13 maybe_plan(4, 'Template 2.20',
15 'SQL::Translator::Parser::XML::SQLFairy')
17 use Test::Differences;
21 # Access to test libs. We want Producer/BaseTest.pm from here.
25 # Parse the test XML schema
27 $obj = SQL::Translator->new(
31 from => "XML-SQLFairy",
32 filename => "$Bin/data/xml/schema.xml",
33 to => "Producer::BaseTest::produce",
36 lives_ok { $out = $obj->translate; } "Translate ran";
37 is $obj->error, '' ,"No errors";
38 ok $out ne "" ,"Produced something!";
39 local $/ = undef; # slurp
40 eq_or_diff $out, <DATA> ,"Output looks right";
45 Tables: Basic, Another
49 Fields: id title description email explicitnulldef explicitemptystring emptytagdef another_id timest