From: Darren Chamberlain Date: Fri, 18 Apr 2003 14:25:58 +0000 (+0000) Subject: Forgot to add this yesterday. X-Git-Tag: v0.02~186 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5db56bf60de7ff8e816086e0d43c27184da427b4;p=dbsrgits%2FSQL-Translator.git Forgot to add this yesterday. --- diff --git a/t/11normalize.t b/t/11normalize.t new file mode 100644 index 0000000..7a6c9ba --- /dev/null +++ b/t/11normalize.t @@ -0,0 +1,22 @@ +#!/usr/bin/perl +# vim: set ft=perl: + +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}'"); +}