diff options
author | doy <doy@tozt.net> | 2008-12-07 00:33:20 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-07 00:33:20 -0500 |
commit | f72f582111bb4da827ed4fb7a7ff855f6faf9786 (patch) | |
tree | 440a41e961908b5930a43c04930e24931695dd14 /t/001-basic-matching.t | |
parent | 1f7c809af24762d7a1c0d1fab184a3ef1d8c54cd (diff) | |
download | moosex-role-matcher-f72f582111bb4da827ed4fb7a7ff855f6faf9786.tar.gz moosex-role-matcher-f72f582111bb4da827ed4fb7a7ff855f6faf9786.zip |
use $_ for passing the value to coderef matchers, rather than passing it as an argument
Diffstat (limited to 't/001-basic-matching.t')
-rw-r--r-- | t/001-basic-matching.t | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/001-basic-matching.t b/t/001-basic-matching.t index 45852ca..e45b43f 100644 --- a/t/001-basic-matching.t +++ b/t/001-basic-matching.t @@ -18,9 +18,9 @@ ok($foo->match(a => 'foo', b => 'bar', c => 'baz'), 'string matching works'); ok($foo->match(a => qr/o/), 'regex matching works'); -ok($foo->match(b => sub { length(shift) == 3 }), +ok($foo->match(b => sub { length == 3 }), 'subroutine matching works'); -ok($foo->match(a => 'foo', b => qr/a/, c => sub { substr(shift, 2) eq 'z' }), +ok($foo->match(a => 'foo', b => qr/a/, c => sub { substr($_, 2) eq 'z' }), 'combined matching works'); $foo = Foo->new(a => 'foo'); ok($foo->match(a => 'foo', b => undef), |