Commit | Line | Data |
5db56bf6 |
1 | #!/usr/bin/perl |
2 | # vim: set ft=perl: |
3 | |
4 | use Test::More; |
5 | use SQL::Translator::Utils qw(normalize_name); |
6 | |
7 | my %tests = ( |
8 | "silly field (with random characters)" => "silly_field_with_random_characters", |
9 | "444" => "_444", |
10 | "hello, world" => "hello_world", |
11 | "- 9s80 qwehjf 4r" => "_9s80_qwehjf_4r", |
12 | ); |
13 | |
14 | plan tests => scalar(keys %tests) + 1; |
15 | |
16 | # Superfluous test, but that's ok |
17 | use_ok("SQL::Translator::Utils"); |
18 | |
19 | for my $test (keys %tests) { |
20 | is(normalize_name($test) => $tests{$test}, |
21 | "normalize_name('$test') => '$tests{$test}'"); |
22 | } |