From: Darren Chamberlain Date: Thu, 21 Mar 2002 15:53:21 +0000 (+0000) Subject: Added some basic files, removed unused data file (the contents were moved into the... X-Git-Tag: v0.01~58^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35bab74243827d6e141cd8b3986b1e9bb1f37f07;p=dbsrgits%2FSQL-Translator.git Added some basic files, removed unused data file (the contents were moved into the test that used the data). --- diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..7d5a614 --- /dev/null +++ b/BUGS @@ -0,0 +1,2 @@ +MySQL parser chokes on DEFAULT x NOT NULL, but works with NOT NULL DEFAULT x +MySQL parser chokes on FULLTEXT index creation. diff --git a/TODO b/TODO new file mode 100644 index 0000000..11c7317 --- /dev/null +++ b/TODO @@ -0,0 +1,8 @@ +Define structure of the data returned by parsers: + o Producers need to know what to expect + o For testing purposes, we need to know if parsers are returning + something reasonable + +cvs rm t/data/mysql/Apache-Session-MySQL.sql +cvs add TODO +cvs add t/01load.t diff --git a/t/01load.t b/t/01load.t new file mode 100644 index 0000000..cc47a99 --- /dev/null +++ b/t/01load.t @@ -0,0 +1,36 @@ +#!/usr/bin/perl +# vim: set ft=perl: +# +# This test attempts to load every .pm file in MANIFEST. +# It might be naive. +# + +my @perlmods; +my $count = 0; + +unless (open MANIFH, "MANIFEST") { + print "1..1\n"; + print "not ok 1\n"; + exit; +} +while () { + chomp; + if (s/\.pm$//) { + s,/,::,g; + s/^lib:://; + push @perlmods, $_ + } +} + +print "1.." . scalar @perlmods . "\n"; + +close MANIFH; + +for my $mod (@perlmods) { + $count++; + $mod =~ s,/,::,g; + eval "use $mod;"; + print "not " if ($@); + print "ok $count # $mod\n"; +} + diff --git a/t/05bgep-re.t b/t/05bgep-re.t new file mode 100644 index 0000000..18bd3ff --- /dev/null +++ b/t/05bgep-re.t @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# vim: set ft=perl: +# + +use strict; +use Data::Dumper; +use SQL::Translator; +use SQL::Translator::Parser::MySQL qw(parse); + +$SQL::Translator::DEBUG = 0; + +my $tr = SQL::Translator->new; + +my $datafile = "t/data/mysql/BGEP-RE-create.sql"; +my $data; +open FH, $datafile or die "Can't open $datafile: $!"; +read(FH, $data, -s $datafile); +close FH; + +print "Data is ", length $data, " bytes\n"; +#print $data; + +my $val = parse($tr, $data); +print Dumper($val); diff --git a/t/data/mysql/Apache-Session-MySQL.sql b/t/data/mysql/Apache-Session-MySQL.sql deleted file mode 100644 index 7f0b417..0000000 --- a/t/data/mysql/Apache-Session-MySQL.sql +++ /dev/null @@ -1,6 +0,0 @@ -# Taken from Apache::Session::MySQL -CREATE TABLE sessions ( - id char(32) not null primary key, - a_session text -); -