X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F38-filter-names.t;h=4edd79343778395eed3ad3f03b439256bc8c690a;hb=cb9bbc68fe26aa563d28d590221f6a0235b4062e;hp=8802c86fbb5dc2ee43d44135efbfb0eff4ccfc1a;hpb=0e4526944c49a69baaa77efa8f426e04c52d5e95;p=dbsrgits%2FSQL-Translator.git diff --git a/t/38-filter-names.t b/t/38-filter-names.t index 8802c86..4edd793 100644 --- a/t/38-filter-names.t +++ b/t/38-filter-names.t @@ -33,14 +33,11 @@ schema: procedures: {} tables: person: - comments: '' constraints: [] fields: First_name: - comments: '' data_type: foovar default_value: ~ - extra: {} is_nullable: 1 is_primary_key: 0 is_unique: 0 @@ -64,7 +61,7 @@ translator: producer_type: SQL::Translator::Producer::YAML show_warnings: 1 trace: 0 - version: 0.07 + version: SUPPRESSED }; # Parse the test schema @@ -77,7 +74,7 @@ $obj = SQL::Translator->new( data => $in_yaml, filters => [ # Filter from SQL::Translator::Filter::* - [ 'Names', { + [ 'Names', { tables => 'lc', fields => 'ucfirst', } ], @@ -89,4 +86,7 @@ my $out; lives_ok { $out = $obj->translate; } "Translate ran"; is $obj->error, '' ,"No errors"; ok $out ne "" ,"Produced something!"; +# Somewhat hackishly modify the yaml with a regex to avoid +# failing randomly on every change of version. +$out =~ s/version: .*/version: SUPPRESSED/; eq_or_diff $out, $ans_yaml ,"Output looks right";