6 use SQL::Translator::Generator::DDL::SQLServer;
7 use SQL::Translator::Schema::Field;
8 use SQL::Translator::Schema::Table;
10 my $shim = SQL::Translator::Generator::DDL::SQLServer->new();
12 is $shim->field(SQL::Translator::Schema::Field->new(
15 )), '[lol] int NULL', 'simple field is generated correctly';
17 is $shim->field(SQL::Translator::Schema::Field->new(
19 data_type => 'varchar',
21 )), '[nice] varchar(10) NULL', 'sized field is generated correctly';
23 my $table = SQL::Translator::Schema::Table->new(
30 extra => { list => [qw(foo ba'r)] },
33 like $shim->table($table),
34 qr/\b\QCONSTRAINT [myenum_chk] CHECK ([myenum] IN ('foo','ba''r'))\E/,
35 'enum constraint is generated and escaped correctly';