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);
21 #=============================================================================
25 maybe_plan(4, 'Template', 'Test::Differences')
27 use Test::Differences;
30 use SQL::Translator::Producer::TTSchema;
32 # Parse the test XML schema
34 $obj = SQL::Translator->new(
35 debug => DEBUG, #$opt{d},
38 from => "XML-SQLFairy",
39 filename => "$Bin/data/xml/schema.xml",
40 to => "Producer::BaseTest::produce",
43 lives_ok { $out = $obj->translate; } "Translate ran";
44 is $obj->error, '' ,"No errors";
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;
58 Fields: id title description email explicitnulldef explicitemptystring emptytagdef