Test file for header_comment function from SQL::Translator::Utils.
Darren Chamberlain [Fri, 25 Apr 2003 11:48:12 +0000 (11:48 +0000)]
MANIFEST
t/12header_comment.t [new file with mode: 0644]

index 870f0c6..21f4af9 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -42,6 +42,7 @@ t/08postgres-to-mysql.t
 t/09auto-dia.t
 t/10excel.t
 t/11normalize.t
+t/12header_comment.t
 t/data/pgsql/Chado-CV-PostGreSQL.sql
 t/data/Excel/t.xls
 t/data/mysql/Apache-Session-MySQL.sql
diff --git a/t/12header_comment.t b/t/12header_comment.t
new file mode 100644 (file)
index 0000000..0713d17
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+# vim: set ft=perl:
+
+use Test::More;
+use SQL::Translator::Utils qw($DEFAULT_COMMENT header_comment);
+
+plan tests => 5;
+
+# Superfluous test, but that's ok
+use_ok("SQL::Translator::Utils");
+
+is($DEFAULT_COMMENT, '-- ', 'default comment');
+like(header_comment("foo"), qr/[-][-] Created by foo/, "Created by...");
+
+my $comm = header_comment("My::Producer",
+                          $DEFAULT_COMMENT,
+                          "Hi mom!");
+like($comm, qr/[-][-] Created by My::Producer/, 'Multiline header comment...');
+like($comm, qr/[-][-] Hi mom!/, '...with additional junk');