X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F34tt-base.t;h=f69f2aa66163a2d8f4a2044437b51c65b2b20758;hb=e83ad71c8681208b81dacee01240c2b78752b83e;hp=fc67484924de4141d3f687240425ded434719803;hpb=f28712a452a3d19bbe9083d603107e0ab6a0eac9;p=dbsrgits%2FSQL-Translator.git diff --git a/t/34tt-base.t b/t/34tt-base.t index fc67484..f69f2aa 100644 --- a/t/34tt-base.t +++ b/t/34tt-base.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w # vim:filetype=perl # Before `make install' is performed this script should be runnable with @@ -9,34 +9,27 @@ use Test::More; use Test::Exception; use Test::SQL::Translator qw(maybe_plan); -use Data::Dumper; -use vars '%opt'; -BEGIN { map { $opt{$_}=1 if s/^-// } @ARGV; } -use constant DEBUG => (exists $opt{d} ? 1 : 0); - -use FindBin qw/$Bin/; -use lib ("$Bin/lib"); - -# Testing 1,2,3,4... -#============================================================================= -package main; - BEGIN { - maybe_plan(4, 'Template', 'Test::Differences') + maybe_plan(4, 'Template 2.20', + 'Test::Differences', + 'SQL::Translator::Parser::XML::SQLFairy') } use Test::Differences; use SQL::Translator; -use SQL::Translator::Producer::TTSchema; +use FindBin qw/$Bin/; +# Access to test libs. We want Producer/BaseTest.pm from here. +use lib ("$Bin/lib"); + # Parse the test XML schema my $obj; $obj = SQL::Translator->new( - debug => DEBUG, #$opt{d}, - show_warnings => 1, + debug => 0, + show_warnings => 0, add_drop_table => 1, from => "XML-SQLFairy", - filename => "$Bin/data/xml/schema-basic.xml", + filename => "$Bin/data/xml/schema.xml", to => "Producer::BaseTest::produce", ); my $out; @@ -46,13 +39,16 @@ ok $out ne "" ,"Produced something!"; local $/ = undef; # slurp eq_or_diff $out, ,"Output looks right"; -print $out if DEBUG; -#print "Debug:", Dumper($obj) if DEBUG; __DATA__ Hello World -Tables: Basic +Tables: Basic, Another Basic ------ -Fields: id title description email explicitnulldef explicitemptystring emptytagdef +Fields: id title description email explicitnulldef explicitemptystring emptytagdef another_id timest + +Another +------ +Fields: id num +