-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improved tests
- Loading branch information
Showing
11 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
use Test::More tests => 1; | ||
use Test::More; | ||
|
||
use Symbol::Approx::Sub (xform => [ 'Text::Soundex' ]); | ||
|
||
|
||
sub a_a { 'aa' } | ||
|
||
ok(aa() eq 'aa'); | ||
is(aa(), 'aa'); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
use Test::More tests => 1; | ||
use Test::More; | ||
|
||
use Symbol::Approx::Sub (xform => [ sub { map { s/[^a-z]//ig; $_ } @_ }, | ||
sub { map { lc } @_ } ]); | ||
|
||
|
||
sub a_a { 'aa' } | ||
|
||
ok(AA() eq 'aa'); | ||
is(AA(), 'aa'); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
use Test::More tests => 4; | ||
use Test::More; | ||
|
||
use_ok('Symbol::Approx::Sub'); | ||
|
||
sub aa { 'aa' } | ||
|
||
sub bb { 'bb' } | ||
|
||
ok(a() eq 'aa'); | ||
is(a(), 'aa'); | ||
|
||
ok(b() eq 'bb'); | ||
is(b(), 'bb'); | ||
|
||
eval "c()"; | ||
eval { c() }; | ||
ok($@); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
use Test::More tests => 1; | ||
use Test::More; | ||
|
||
use Symbol::Approx::Sub (xform => sub { map { s/[^A-Za-z]//g; $_ } @_ }); | ||
|
||
sub a_a { 'aa' } | ||
|
||
ok(aa() eq 'aa'); | ||
is(aa(), 'aa'); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
use Test::More tests => 3; | ||
use Test::More; | ||
|
||
package x; | ||
package Foo; | ||
|
||
use Symbol::Approx::Sub (xform => 'Text::Soundex'); | ||
Test::More::ok(bar() eq 'yep'); | ||
Test::More::is(bar(), 'yep'); | ||
sub baar {'yep'} | ||
sub qux {12} | ||
|
||
package y; | ||
package Bar; | ||
use Symbol::Approx::Sub (canon => undef, | ||
match => sub {shift; return 0 .. $#_}); | ||
Test::More::ok(&x::quux()==12); | ||
Test::More::ok(&y::quux()==23); | ||
Test::More::is(Foo::quux(), 12); | ||
Test::More::is(Bar::quux(), 23); | ||
|
||
sub flurble {23} | ||
|
||
package main; | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
use Test::More tests => 1; | ||
use Test::More; | ||
|
||
use Symbol::Approx::Sub (choose => 'String::Equal'); | ||
|
||
|
||
sub aa { 'aa' } | ||
|
||
ok(a() eq 'aa'); | ||
is(a(), 'aa'); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
use Test::More tests => 1; | ||
use Test::More; | ||
|
||
use Symbol::Approx::Sub (xform => 'Text::Soundex'); | ||
|
||
|
||
sub a_a { 'aa' } | ||
|
||
ok(aa() eq 'aa'); | ||
is(aa(), 'aa'); | ||
|
||
done_testing; |