t/lib/SchemaIterator.t shouldn't assume that the order of the foreign key constraints is deterministic

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-06-04 18:39:10 -03:00
parent 1a47970469
commit ccd1e58785

View File

@@ -93,14 +93,10 @@ sub test_so {
}
return \@objs if $args{return_objs};
if ( $result_file ) {
ok(
no_diff(
$res,
$args{result},
cmd_output => 1,
),
is(
sort_query_output($res),
sort_query_output(do { local $/; open(my $fh, "<", $args{result}); <$fh>}),
$args{test_name},
);
}
@@ -122,6 +118,17 @@ sub test_so {
return;
}
sub sort_query_output {
my $queries = shift;
my @queries = split /\n\n/, $queries;
my $sorted;
for my $query (@queries) {
$sorted .= join "\n", sort split /\n/, $query;
}
return $sorted;
}
SKIP: {
skip "Cannot connect to sandbox master", 22 unless $dbh;
$sb->wipe_clean($dbh);