Skip to content

Commit

Permalink
Extend subtest verify_sound_image (t/17-basetest.t)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-richardson committed Nov 22, 2022
1 parent f73f948 commit 470b2c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion t/17-basetest.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ my $jsonmod = Test::MockModule->new('myjsonrpc');
$autotest::isotovideo = 1;

my $last_screenshot_data;
my $suppress_match;
my @reset_consoles;
my @selected_consoles;

Expand All @@ -52,7 +53,8 @@ sub fake_read_json ($fd) {
};
}
elsif ($cmd eq 'backend_verify_image') {
return {ret => {found => {needle => {name => 'foundneedle', file => 'foundneedle.json'}, area => [{x => 1, y => 2, similarity => 100}]}, candidates => []}};
return {ret => {found => {needle => {name => 'foundneedle', file => 'foundneedle.json'}, area => [{x => 1, y => 2, similarity => 100}]}, candidates => []}} unless $suppress_match;
return {ret => {candidates => [{name => 'foundneedle', file => 'foundneedle.json'}]}};
}
elsif ($cmd eq 'last_milestone_console') {
return {};
Expand Down Expand Up @@ -482,6 +484,9 @@ subtest verify_sound_image => sub {
is_deeply($res->{area}, [{x => 1, y => 2, similarity => 100}], 'area was returned') or diag explain $res->{area};
is($res->{needle}->{file}, 'foundneedle.json', 'needle file was returned');
is($res->{needle}->{name}, 'foundneedle', 'needle name was returned');
# $suppress_match = 'yes';
# my $test_without_match = basetest->new();
# $res = $test_without_match->verify_sound_image("$FindBin::Bin/data/frame1.ppm", 'notapath2', 'check');
};

subtest rollback_activated_consoles => sub {
Expand Down

0 comments on commit 470b2c2

Please sign in to comment.