diff options
Diffstat (limited to 't/op/lock.t')
-rw-r--r-- | t/op/lock.t | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/t/op/lock.t b/t/op/lock.t index 2fd67821eb..c40ec4c9fd 100644 --- a/t/op/lock.t +++ b/t/op/lock.t @@ -10,9 +10,7 @@ plan tests => 5; is \lock $foo, \$foo, 'lock returns a scalar argument'; is lock @foo, \@foo, 'lock returns a ref to its array argument'; is lock %foo, \%foo, 'lock returns a ref to its hash argument'; -eval { lock &foo }; my $file = __FILE__; my $line = __LINE__; -is $@, "Can't modify non-lvalue subroutine call at $file line $line.\n", - 'Error when locking non-lvalue sub'; +is lock &foo, \&foo, 'lock returns a ref to its code argument'; sub eulavl : lvalue { $x } -is \lock &eulavl, \$x, 'locking lvalue sub acts on retval, just like tie'; +is lock &eulavl, \&eulavl, 'lock returns a ref to its lvalue sub arg'; |