add tests and test data
[dbsrgits/SQL-Translator-2.0-ish.git] / t / 62roundtrip_datacheck.t
index ffcb9da..0bdf0c7 100644 (file)
@@ -1,14 +1,9 @@
 use warnings;
 use strict;
-use Test::SQL::Translator;
+use Test::More;
 use Test::Differences;
 use FindBin qw/$Bin/;
 
-BEGIN {
-    maybe_plan(1, 'SQL::Translator::Parser::XML',
-                  'SQL::Translator::Producer::XML');
-}
-
 # It's very hard to read and modify YAML by hand. Thus we
 # use an XML file for definitions, and generate a YAML from
 # it in Makefile.PL, so we do not saddle the user with XML
@@ -31,11 +26,15 @@ sub _parse_to_xml {
   my $tr = SQL::Translator->new;
   $tr->no_comments (1); # this will drop the XML header
 
+  open (my $fh, '<', $fn) or die "$fn: $!"; 
+
   my $xml = $tr->translate (
     parser => $type,
-    file => $fn,
+    data => do { local $/; <$fh> },
     producer => 'XML',
   ) or die $tr->error;
 
   return $xml;
 }
+
+done_testing;