File: 02synopsis.t

package info (click to toggle)
liblexical-underscore-perl 0.004-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156 kB
  • sloc: perl: 19; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (7)
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
no if $] > 5.018000, warnings => qw(experimental);

use Test::More;
BEGIN {
	$] >= 5.010 or plan skip_all => "test requires Perl 5.010";
};

	use 5.010;
	use lexical::underscore;
	#use Test::More;
	
	sub is_uppercase {
		my $var = @_ ? shift : ${lexical::underscore()};
		return $var eq uc($var);
	}
	
	my $thing = 'FOO';
	my $works = 0;
	
	given ( $thing ) {
		when ( is_uppercase ) { $works++ }
	}
	
	ok($works);
	done_testing();