Forgot to add this yesterday.
Darren Chamberlain [Fri, 18 Apr 2003 14:25:58 +0000 (14:25 +0000)]
t/11normalize.t [new file with mode: 0644]

diff --git a/t/11normalize.t b/t/11normalize.t
new file mode 100644 (file)
index 0000000..7a6c9ba
--- /dev/null
@@ -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}'");
+}