Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[t] start to compare numbers numerically

  • Loading branch information...
commit e0ca68b4286e7cbb4a7594a6cc3b64fe538ac1a7 1 parent 3100834
Moritz Lenz moritz authored

Showing 1 changed file with 13 additions and 1 deletion. Show diff stats Hide diff stats

  1. +13 1 t/99-common.pl6
14 t/99-common.pl6
@@ -7,6 +7,18 @@
7 7 diag "Testing MiniDBD::$*mdriver";
8 8 plan 33;
9 9
  10 +sub magic_cmp(@a, @b) {
  11 + my $res = @a[0] eq @b[0]
  12 + && @a[1] eq @b[1]
  13 + && @a[2] == @b[2]
  14 + && @a[3] == @b[3];
  15 + unless $res {
  16 + diag " Got: @a[]";
  17 + diag "Expected: @b[]";
  18 + }
  19 + $res;
  20 +}
  21 +
10 22 # Verify that the driver loads before attempting a connect
11 23 my $drh = DBIish.install_driver($*mdriver);
12 24 ok $drh, 'Install driver'; # test 1
@@ -147,7 +159,7 @@ ok $sth.execute(), 'execute prepared statement for fetchrow_arrayref'; #test 29
147 159 if 'fetchrow_arrayref' eq any ($sth.^methods) {
148 160 ok my $arrayref = $sth.fetchrow_arrayref(), 'called fetchrow_arrayref'; #test 30
149 161 is $arrayref.elems, 4, "fetchrow_arrayref returns 4 fields in a row"; #test 31
150   - is $arrayref, [ 'PICO', 'Delish pina colada', '5', '7.9' ],
  162 + ok magic_cmp($arrayref, [ 'PICO', 'Delish pina colada', '5', '7.9' ]),
151 163 'selected data matches test data of fetchrow_arrayref'; #test 32
152 164 }
153 165 else { skip 'fetchrow_arrayref not implemented', 2 }

0 comments on commit e0ca68b

Please sign in to comment.
Something went wrong with that request. Please try again.