File: keep_tabs.t

package info (click to toggle)
perl 5.42.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 128,392 kB
  • sloc: perl: 534,963; ansic: 240,563; sh: 72,042; pascal: 6,934; xml: 2,428; yacc: 1,360; makefile: 1,197; cpp: 208; lisp: 1
file content (29 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (5)
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
# This file contains tests where \t characters should not be expanded into
# spaces.

BEGIN {
    chdir 't' if -d 't';
    require './test.pl';
}

{
      like("\t", qr/[a	b]/x, '\t not ignored under /x');
    unlike("\t", qr/[a	b]/xx, '\t ignored under /xx');
    like("a", qr/[a	b]/xx, '"a" matches qr/[a	b]/xx');
    like("b", qr/[a	b]/xx, '"b" matches qr/[a	b]/xx');
    like("\t", qr/[a\	b]/xx, '"\t" matches qr/[a\	b]/xx');
    like("a", qr/[a\	b]/xx, '"a" matches qr/[a\	b]/xx');
    like("b", qr/[a\	b]/xx, '"b" matches qr/[a\	b]/xx');

      like("\t", qr/(?x:[a	b])/, '\t not ignored under /x');
    unlike("\t", qr/(?xx:[a	b])/, '\t ignored under /xx');
    like("a", qr/(?xx:[a	b])/, '"a" matches qr/(?xx:[a	b])/');
    like("b", qr/(?xx:[a	b])/, '"b" matches qr/(?xx:[a	b])/');
    like("\t", qr/(?xx:[a\	b])/, '"\t" matches qr/(?xx:[a\	b])/');
    like("a", qr/(?xx:[a\	b])/, '"a" matches qr/(?xx:[a\	b])/');
    like("b", qr/(?xx:[a\	b])/, '"b" matches qr/(?xx:[a\	b])/');
}

done_testing;

# ex softtabstop=0 noexpandtab