From: Darren Chamberlain Date: Fri, 25 Apr 2003 11:48:12 +0000 (+0000) Subject: Test file for header_comment function from SQL::Translator::Utils. X-Git-Tag: v0.02~165 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=631aafb6e016b361f6d11e5905c9f605bf79214c;p=dbsrgits%2FSQL-Translator.git Test file for header_comment function from SQL::Translator::Utils. --- diff --git a/MANIFEST b/MANIFEST index 870f0c6..21f4af9 100644 --- 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 index 0000000..0713d17 --- /dev/null +++ b/t/12header_comment.t @@ -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');