Some aesthetic changes
[dbsrgits/SQL-Translator.git] / t / 65-generator-utils.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 use SQL::Translator::Generator::Utils;
7
8 my $util = SQL::Translator::Generator::Utils->new(
9    quote_chars => ['[', ']'],
10 );
11
12 is $util->quote('frew'), '[frew]', 'simple quote works';
13 is $util->quote('people.frew'), '[people].[frew]', 'namespaced quote works';
14
15 my $single_util = SQL::Translator::Generator::Utils->new(
16    quote_chars => q(|),
17 );
18
19 is $single_util->quote('frew'), '|frew|', 'simple single quote works';
20 is $single_util->quote('people.frew'), '|people|.|frew|', 'namespaced single quote works';
21
22 my $no_util = SQL::Translator::Generator::Utils->new();
23
24 is $no_util->quote('frew'), 'frew', 'simple no quote works';
25 is $no_util->quote('people.frew'), 'people.frew', 'namespaced no quote works';
26
27 done_testing;