Skip to content
Snippets Groups Projects
Commit 381c2cb0 authored by Andy Yates's avatar Andy Yates
Browse files

removing smart match operators from the test suite

parent 991a724a
No related branches found
No related tags found
No related merge requests found
......@@ -337,21 +337,28 @@ foreach my $sl (sort keys %{$slices}) {
foreach my $table (@tables) {
my $query;
my $table_in_stable_id_tables = 0;
foreach my $stable_id_table (@stable_id_tables) {
$table_in_stable_id_tables = 1 if $stable_id_table eq $table;
last;
}
if ($sstart > $send) {
$query = sprintf $query_templates[0], $table, $table ~~ @stable_id_tables?', stable_id':'', $table, $seq_id, $sstart, $send, $sstart, $send;
} else {
$query = sprintf $query_templates[1], $table, $table ~~ @stable_id_tables?', stable_id':'', $table, $seq_id, $send, $sstart, $send, $sstart;
$query = sprintf $query_templates[0], $table, $table_in_stable_id_tables ? ', stable_id':'', $table, $seq_id, $sstart, $send, $sstart, $send;
}
else {
$query = sprintf $query_templates[1], $table, $table_in_stable_id_tables ? ', stable_id':'', $table, $seq_id, $send, $sstart, $send, $sstart;
}
my $expected_objects =
$sql_helper->execute(
-SQL => $query,
-USE_HASHREFS => 1,
-CALLBACK => sub {
my $row = shift @_;
return feature_slice_boundaries($row, $sstart, $send, $sstrand, $srl);
});
my $expected_objects = $sql_helper->execute(
-SQL => $query,
-USE_HASHREFS => 1,
-CALLBACK => sub {
my $row = shift @_;
return feature_slice_boundaries($row, $sstart, $send, $sstrand, $srl);
}
);
my $method = ucfirst($table); $method =~ s/_([a-z])/\u$1/g; $method = sprintf 'get_all_%ss', $method;
# print "Calling $method\n";
......@@ -359,25 +366,19 @@ foreach my $sl (sort keys %{$slices}) {
is(scalar @{$got_objects}, scalar @{$expected_objects}, sprintf "Number of $table objects on slice [%d, %d]", $sstart, $send);
foreach my $expected (@{$expected_objects}) {
my $got = (grep { $expected->{db_id} == $_->dbID } @{$got_objects})[0];
SKIP: {
skip 'Cannot test attributes with no returned object', 1 unless $got;
ok($got, sprintf "Object of type $table (%d) retrieved", $got->dbID);
is($got->stable_id, $expected->{stable_id}, sprintf "%d: stable id", $got->dbID)
if $table ~~ @stable_id_tables;
is($got->start, $expected->{start}, sprintf "%d: start", $got->dbID);
is($got->end, $expected->{end}, sprintf "%d: end", $got->dbID);
is($got->strand, $expected->{strand}, sprintf "%d: strand", $got->dbID);
}
}
my $got = (grep { $expected->{db_id} == $_->dbID } @{$got_objects})[0];
SKIP: {
skip 'Cannot test attributes with no returned object', 1 unless $got;
ok($got, sprintf "Object of type $table (%d) retrieved", $got->dbID);
is($got->stable_id, $expected->{stable_id}, sprintf "%d: stable id", $got->dbID) if $table_in_stable_id_tables;
is($got->start, $expected->{start}, sprintf "%d: start", $got->dbID);
is($got->end, $expected->{end}, sprintf "%d: end", $got->dbID);
is($got->strand, $expected->{strand}, sprintf "%d: strand", $got->dbID);
}
}
}
}
}
#
......
......@@ -180,8 +180,6 @@ sub compare_after_patches {
$dbc->do("use $source_schema");
my $source_patches = $sql_helper->execute_simple(-SQL => "select meta_value from meta where meta_key='patch' and meta_value like 'patch_${last_release}_${current_release}_%'");
# Does not work on <5.10 versions of Perl
# map { ok($_ ~~ @{$source_patches}, "$_ in patched database") } @{$target_patches};
my %source_patches;
map { $source_patches{$_}++ } @{$source_patches};
map { ok(exists $source_patches{$_}, "$_ in patched database") } @{$target_patches};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment