1#!/usr/bin/perl 2use strict; 3 4use FindBin qw/$Bin/; 5use Test::More; 6use Test::SQL::Translator; 7use Test::Exception; 8use Data::Dumper; 9use SQL::Translator; 10use SQL::Translator::Schema::Constants; 11 12BEGIN { 13 maybe_plan(3, 'SQL::Translator::Parser::YAML', 14 'SQL::Translator::Producer::Oracle'); 15} 16 17my $yamlfile = "$Bin/data/oracle/schema_with_options.yaml"; 18 19my $sqlt; 20$sqlt = SQL::Translator->new( 21 show_warnings => 0, 22 add_drop_table => 0, 23); 24 25my $sql_string = $sqlt->translate( 26 from => 'YAML', 27 to => 'Oracle', 28 filename => $yamlfile, 29); 30 31ok($sql_string, 'Translation successfull'); 32ok($sql_string =~ /TABLESPACE\s+DATA/, 'Table options'); 33ok($sql_string =~ /TABLESPACE\s+INDX/, 'Index options'); 34