File: 11normalize.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 (23 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl
# vim: set ft=perl:

use strict;
use Test::More;
use SQL::Translator::Utils qw(normalize_name);

my %tests = (
    "silly field (with random characters)" => "silly_field_with_random_characters",
    "444"   => "_444",
    "hello, world" => "hello_world",
    "- 9s80     qwehjf 4r" => "_9s80_qwehjf_4r",
);

plan tests => scalar(keys %tests) + 1;

# Superfluous test, but that's ok
use_ok("SQL::Translator::Utils");

for my $test (keys %tests) {
    is(normalize_name($test) => $tests{$test},
        "normalize_name('$test') => '$tests{$test}'");
}