Commit | Line | Data |
27ae9ae7 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | |
6 | use SQL::Translator::Shim; |
7 | |
8 | my $shim = SQL::Translator::Shim->new( |
9 | quote_chars => ['[', ']'], |
10 | ); |
11 | |
12 | is $shim->quote('frew'), '[frew]', 'simple quote works'; |
13 | is $shim->quote('people.frew'), '[people].[frew]', 'namespaced quote works'; |
14 | |
15 | my $single_shim = SQL::Translator::Shim->new( |
16 | quote_chars => q(|), |
17 | ); |
18 | |
19 | is $single_shim->quote('frew'), '|frew|', 'simple single quote works'; |
20 | is $single_shim->quote('people.frew'), '|people|.|frew|', 'namespaced single quote works'; |
21 | |
22 | my $no_shim = SQL::Translator::Shim->new(); |
23 | |
24 | is $no_shim->quote('frew'), 'frew', 'simple no quote works'; |
25 | is $no_shim->quote('people.frew'), 'people.frew', 'namespaced no quote works'; |
26 | |
27 | done_testing; |