Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move tests for is_approx to a separate file
It's deprecated so it's tested separately.
  • Loading branch information
pmurias committed Mar 28, 2017
1 parent 5ca924d commit 42f34fb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
20 changes: 20 additions & 0 deletions t/01-sanity/98-test-deprecated.t
@@ -0,0 +1,20 @@
use v6;

use lib <lib>;
use Test;

my $approx1 = is_approx 1, 1, 'is_approx with description';
ok $approx1, 'is_approx 1,1, returns True';
my $approx2 = is_approx 1, 1;
my $approx3 = is_approx 1, 1.000001, 'is_approx with small difference';
ok $approx3, 'is_approx 1,1.000001, returns True';

# NOT_TODO
todo( 'failing is_approx 1,2;');
my $approx4 = is_approx 1, 2, 'is_approx with small difference';
nok $approx4, 'is_approx 1, 2; fails and returns False';

ok Deprecation.report ~~ /is_approx/, 'is_approx is deprecated';
done-testing;

# vim: ft=perl6
13 changes: 0 additions & 13 deletions t/01-sanity/99-test-basic.t
Expand Up @@ -49,19 +49,6 @@ todo( 'testing isnt 1,1' );
my $isnt3 = isnt 1, 1, 'isnt 1,1, with description';
nok $isnt3, 'isnt 1, 1; returns False';


my $approx1 = is_approx 1, 1, 'is_approx with description';
ok $approx1, 'is_approx 1,1, returns True';
my $approx2 = is_approx 1, 1;
my $approx3 = is_approx 1, 1.000001, 'is_approx with small difference';
ok $approx3, 'is_approx 1,1.000001, returns True';

# NOT_TODO
todo( 'failing is_approx 1,2;');
my $approx4 = is_approx 1, 2, 'is_approx with small difference';
nok $approx4, 'is_approx 1, 2; fails and returns False';


todo( 'testing todo twice', 2 );
ok 0, 'this should fail, to test todo()';
ok 0, 'this should also fail, to test todo()';
Expand Down

0 comments on commit 42f34fb

Please sign in to comment.