Only output trigger 'scope' if it's set in YAML and JSON producers
[dbsrgits/SQL-Translator.git] / t / 11normalize.t
CommitLineData
5db56bf6 1#!/usr/bin/perl
2# vim: set ft=perl:
3
94ac836f 4use strict;
5db56bf6 5use Test::More;
6use SQL::Translator::Utils qw(normalize_name);
7
8my %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
15plan tests => scalar(keys %tests) + 1;
16
17# Superfluous test, but that's ok
18use_ok("SQL::Translator::Utils");
19
20for my $test (keys %tests) {
21 is(normalize_name($test) => $tests{$test},
22 "normalize_name('$test') => '$tests{$test}'");
23}