File: swash.t

package info (click to toggle)
liblexical-sealrequirehints-perl 0.012-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 360 kB
  • sloc: perl: 340; makefile: 3
file content (55 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use warnings;
use strict;

BEGIN {
	if("$]" < 5.008) {
		require Test::More;
		Test::More::plan(skip_all =>
			"swash loading disagrees with infrastructure");
	}
}

use Test::More tests => 6;

use Lexical::SealRequireHints;
BEGIN { unshift @INC, "./t/lib"; }

BEGIN {
	SKIP: {
		skip "Perl 5.11 doesn't work with localised hint bit", 2
			if "$]" >= 5.011 && "$]" < 5.012;
		$^H = 0;
		is $^H, 0;
		require t::package_0;
		is $^H, 0;
	}
}

BEGIN {
	%^H = ( foo=>1, bar=>2 );
	$^H |= 0x20000;
	is_deeply [ sort keys(%^H) ], [qw(bar foo)];
	if(exists $INC{"utf8.pm"}) {
		SKIP: {
			skip "utf8.pm loaded too early ".
				"(breaking following tests)", 1;
		}
	} else {
		pass;
	}
}
BEGIN {
	# Up to Perl 5.7.0, it is the compilation of this regexp match
	# that triggers swash loading.	From Perl 5.7.1 onwards, it
	# is the execution.  Hence for this test we must arrange for
	# both to occur between the surrounding segments of test code.
	# A BEGIN block achieves this nicely.
	my $x = "bar\x{666}";
	$x =~ /bar\p{Alnum}/;
}
BEGIN {
	ok "$]" >= 5.027011 || exists($INC{"utf8.pm"});
	is_deeply [ sort keys(%^H) ], [qw(bar foo)];
}

1;