Changes to quit using "SqlfXML."
[dbsrgits/SQL-Translator.git] / t / 17sqlfxml-producer.t
index 0ac36c5..1a7ced0 100644 (file)
@@ -4,12 +4,14 @@
 # Before `make install' is performed this script should be runnable with
 # `make test'. After `make install' it should work as `perl test.pl'
 
+local $^W = 0;
+
 use strict;
 use Test::More;
 use Test::Exception;
 
 use Data::Dumper;
-our %opt;
+my %opt;
 BEGIN { map { $opt{$_}=1 if s/^-// } @ARGV; }
 use constant DEBUG => (exists $opt{d} ? 1 : 0);
 use constant TRACE => (exists $opt{t} ? 1 : 0);
@@ -24,7 +26,7 @@ my $file = "$Bin/data/mysql/sqlfxml-producer-basic.sql";
 
 eval { require XML::Writer; };
 if ($@ && $@ =~ m!locate XML::Writer.pm in!) {
-    plan skip_all => "You need XML::Writer to use SqlfXML.";
+    plan skip_all => "You need XML::Writer to use XML::SQLFairy.";
 }
 eval { require Test::Differences; };
 if ($@ && $@ =~ m!locate Test/Differences.pm in!) {
@@ -34,7 +36,7 @@ use Test::Differences;
 plan tests => 6;
     
 use SQL::Translator;
-use SQL::Translator::Producer::SqlfXML;
+use SQL::Translator::Producer::XML::SQLFairy;
 
 my ($obj,$ans,$xml);
 
@@ -78,7 +80,7 @@ $ans = <<EOXML;
         <sqlt:is_nullable>1</sqlt:is_nullable>
         <sqlt:is_foreign_key>0</sqlt:is_foreign_key>
         <sqlt:order>3</sqlt:order>
-        <sqlt:size>0</sqlt:size>
+        <sqlt:size>65535</sqlt:size>
       </sqlt:field>
       <sqlt:field>
         <sqlt:name>email</sqlt:name>
@@ -134,8 +136,8 @@ $obj = SQL::Translator->new(
     trace          => TRACE,
     show_warnings  => 1,
     add_drop_table => 1,
-    from           => "MySQL",
-    to             => "SqlfXML",
+    from           => 'MySQL',
+    to             => 'XML-SQLFairy',
 );
 lives_ok { $xml = $obj->translate($file); }  "Translate ran";
 ok("$xml" ne ""                             ,"Produced something!");
@@ -185,7 +187,7 @@ $ans = <<EOXML;
         <sqlt:is_nullable>1</sqlt:is_nullable>
         <sqlt:is_foreign_key>0</sqlt:is_foreign_key>
         <sqlt:order>7</sqlt:order>
-        <sqlt:size>0</sqlt:size>
+        <sqlt:size>65535</sqlt:size>
       </sqlt:field>
       <sqlt:field>
         <sqlt:name>email</sqlt:name>
@@ -245,8 +247,8 @@ $obj = SQL::Translator->new(
     trace          => TRACE,
     show_warnings  => 1,
     add_drop_table => 1,
-    from           => "MySQL",
-    to             => "SqlfXML",
+    from           => 'MySQL',
+    to             => 'XML-SQLFairy',
     producer_args  => { emit_empty_tags => 1 },
 );
 lives_ok { $xml = $obj->translate($file); }  "Translate ran";
@@ -265,7 +267,7 @@ eq_or_diff $xml, $ans                       ,"XML looks right";
 #     show_warnings  => 1,
 #     add_drop_table => 1,
 #     from           => "MySQL",
-#     to             => "SqlfXML",
+#     to             => "XML-SQLFairy",
 #     producer_args  => { attrib_values => 1 },
 # );
 # print $obj->translate($file);