Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for issue #53, followup to PR #57. #65

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions t/transform.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ if(1) {
@y = ($ul[1], $lr[1], $ur[1], $ll[1]);
$z = undef;
my $t = undef;
ok(Geo::GDAL::FFI::OCTTransform4D($ct, 4, \@x, \@y, \@$z, \@$t), "Coordinate transformation 4D worked");
ok(qq/@x @y/ eq $result, "Resulting coordinates");
@ps = (0,0,0,0);
ok(Geo::GDAL::FFI::OCTTransform4D($ct, 4, \@x, \@y, \@$z, \@$t, \@ps), "Coordinate transformation 4D worked");
ok(qq/@x @y/ eq $result && qq/@ps/ eq qq/1 1 1 1/, "Resulting coordinates");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better written using is_deeply.

my $exp_results = [...];  #  set up expected values
is_deeply ([@x, @y], $exp_result, "Resulting coordinates match");
is_deeply (\@ps, [qw/1 1 1 1/], "Resulting coordinates match, (ps array)");

The is and is_deeply type tests give better feedback when a test fails, i.e they say what was found and was was expected. ok just says there was a failure.


@x = ($ul[0], $lr[0], $ur[0], $ll[0]);
@y = ($ul[1], $lr[1], $ur[1], $ll[1]);
Expand Down
Loading