Added some basic files, removed unused data file (the contents were moved into the...
Darren Chamberlain [Thu, 21 Mar 2002 15:53:21 +0000 (15:53 +0000)]
BUGS [new file with mode: 0644]
TODO [new file with mode: 0644]
t/01load.t [new file with mode: 0644]
t/05bgep-re.t [new file with mode: 0644]
t/data/mysql/Apache-Session-MySQL.sql [deleted file]

diff --git a/BUGS b/BUGS
new file mode 100644 (file)
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 (file)
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 (file)
index 0000000..cc47a99
--- /dev/null
@@ -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 (<MANIFH>) {
+    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 (file)
index 0000000..18bd3ff
--- /dev/null
@@ -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 (file)
index 7f0b417..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Taken from Apache::Session::MySQL
-CREATE TABLE sessions (
-    id char(32) not null primary key,
-    a_session text
-);
-