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