File: 03bindtextdomain_xs.t

package info (click to toggle)
libintl-perl 1.26-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 5,696 kB
  • ctags: 495
  • sloc: perl: 156,143; makefile: 137
file content (67 lines) | stat: -rw-r--r-- 1,364 bytes parent folder | download | duplicates (28)
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
56
57
58
59
60
61
62
63
64
65
66
67
#! /usr/local/bin/perl -w

# vim: syntax=perl
# vim: tabstop=4

use strict;

use Test;

use constant NUM_TESTS => 12;

use Locale::Messages qw (bindtextdomain);

BEGIN {
	my $package;
	if ($0 =~ /_pp\.t$/) {
		$package = 'gettext_pp';
	} else {
		$package = 'gettext_xs';
	}
		
	my $selected = Locale::Messages->select_package ($package);
	if ($selected ne $package && 'gettext_xs' eq $package) {
		print "1..0 # Skip: Locale::$package not available here.\n";
		exit 0;
	}
	plan tests => NUM_TESTS;
}

my $bound_domain = bindtextdomain 'existing';
ok defined $bound_domain;
ok length $bound_domain;

$bound_domain = bindtextdomain 'existing', '.';
ok defined $bound_domain;
ok $bound_domain, '.';

$bound_domain = bindtextdomain 'existing';
ok defined $bound_domain;
ok $bound_domain, '.';

$bound_domain = bindtextdomain 'not_existing';
ok defined $bound_domain;
ok length $bound_domain;

$bound_domain = bindtextdomain 'not_existing', '.';
ok defined $bound_domain;
ok $bound_domain, '.';

$bound_domain = bindtextdomain 'not_existing';
ok defined $bound_domain;
ok $bound_domain, '.';

__END__

Local Variables:
mode: perl
perl-indent-level: 4
perl-continued-statement-offset: 4
perl-continued-brace-offset: 0
perl-brace-offset: -4
perl-brace-imaginary-offset: 0
perl-label-offset: -4
cperl-indent-level: 4
cperl-continued-statement-offset: 2
tab-width: 4
End: