4 # Before `make install' is performed this script should be runnable with
5 # `make test'. After `make install' it should work as `perl test.pl'
10 use Test::SQL::Translator qw(maybe_plan);
13 maybe_plan(3, 'YAML', 'Test::Differences')
15 use Test::Differences;
18 # The _GLOBAL_ table should be removed and its fields copied onto all other
21 # FIXME - the loader should not require order for globals, needs to be able
22 # to recognize/sort approproately
51 # Parse the test XML schema
53 $obj = SQL::Translator->new(
60 # Filter from SQL::Translator::Filter::*
62 # A global field to add given in the args
66 data_type => 'timestamp',
78 ) or die "Failed to create translator object: ".SQL::Translator->error;
81 lives_ok { $struct = YAML::Load($obj->translate) } "Translate/yaml reload ran";
82 is $obj->error, '', "No errors";
84 # Should include the the items added from the Global table defined above in the
85 # schema as well as those defined in the filter args below.
103 reference_fields => [],
104 reference_table => "",
110 data_type => "foovar",
111 default_value => undef,
115 name => "first_name",
122 data_type => "timestamp",
123 default_value => undef,
134 data_type => "timestamp",
135 default_value => undef,
177 parser_type => "SQL::Translator::Parser::YAML",
179 producer_type => "SQL::Translator::Producer::YAML",
182 version => $SQL::Translator::VERSION,
184 }, 'Expected final yaml-schema');