File: 04scalar_noop.t

package info (click to toggle)
texinfo 5.2.0.dfsg.1-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 77,100 kB
  • ctags: 18,410
  • sloc: perl: 899,906; ansic: 44,979; sh: 14,974; xml: 5,685; makefile: 1,202; awk: 451; lisp: 213; sed: 78
file content (54 lines) | stat: -rw-r--r-- 1,000 bytes parent folder | download | duplicates (14)
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
#! /usr/local/bin/perl -w

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

use strict;

use Test;

use constant NUM_TESTS => 5;

use Locale::TextDomain;
use POSIX;

BEGIN {
	plan tests => NUM_TESTS;
}

# When called in scalar context, N__() should return its argument,
# not a list.  On the other hand, the other noop functions should
# simply returns their arguments, see
# https://rt.cpan.org/Ticket/Display.html?id=46471 for more.

my $scalar;

$scalar = scalar N__"foobar";
ok 'foobar' eq $scalar;

($scalar) = scalar N__"foobar";
ok 'foobar' eq $scalar;

$scalar = scalar N__n"one", "two", 4;
ok 3 eq $scalar;

$scalar = scalar N__p"ctx", "foobar";
ok 2 eq $scalar;

$scalar = scalar N__np"ctx", "one", "two", 5;
ok 4 eq $scalar;

__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: