File: 12header_comment.t

package info (click to toggle)
libsql-translator-perl 0.11011-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,380 kB
  • sloc: perl: 251,748; sql: 3,805; xml: 233; makefile: 7
file content (18 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl
# vim: set ft=perl:

use strict;
use Test::More tests => 5;
use SQL::Translator::Utils qw($DEFAULT_COMMENT header_comment);

# 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');