File: code_ident.t

package info (click to toggle)
liblexical-var-perl 0.010-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 464 kB
  • sloc: perl: 76; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use warnings;
use strict;

use Test::More tests => 3*3;

BEGIN { $^H |= 0x20000 if "$]" < 5.008; }

$SIG{__WARN__} = sub { die "WARNING: $_[0]" };

sub x {}
our($oref, $aref, $bref);
foreach(
	\&x,
	sub{},
	sub { my $x; sub{$x} }->(),
) {
	$oref = $_;
	$aref = $bref = undef;
	eval q{
		use Lexical::Var '&foo' => $oref;
		$aref = \&foo;
		$bref = \&foo;
	};
	is $@, "";
	ok $aref == $oref;
	ok $bref == $oref;
}

1;