root/t/magicals/line_basic.t

Revision 21719, 1.2 kB (checked in by lwall, 5 months ago)

[STD] detect obsolete use of =cut
[t/*.t] delete obsolete uses of =cut

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
Line 
1use v6;
2
3use Test;
4
5plan 11;
6
7=begin kwid
8
9Basic tests for #line
10
11=end kwid
12
13my $file = $?FILE;
14
15is($?POSITION, "$file line 15, column 4-14", 'plain old $?POSITION');
16
17my $dummy = 0; # This comment is not column1
18$dummy    = 1; # And neither is this one.
19
20is($?POSITION, "$file line 20, column 4-14", "plain comments don't disrupt position");
21
22# This comment does start column1
23
24is($?POSITION, "$file line 24, column 4-14", "comments column1 don't disrupt position");
25
26#line 1024
27is($?POSITION, "$file line 1024, column 4-14", "basic #line works");
28
29#line1
30is($?POSITION, "$file line 1027, column 4-14", "#line1 (no whitespace) is ignored");
31
32#line1 1
33is($?POSITION, "$file line 1030, column 4-14", "#line1 1 is ignored");
34
35#line 2048 "oneword"
36is($?POSITION, "oneword line 2048, column 4-14", '#line n "filename"');
37
38#line 4096 two words
39is($?POSITION, "oneword line 2051, column 4-14", '#line n two words ignored (should be quoted)');
40
41#line 8192 unquoted
42is($?POSITION, "unquoted line 8192, column 4-14", '#line n unquoted (one word is ok)');
43
44#line 16384 123
45is($?POSITION, "123 line 16384, column 4-14", '#line n unquoted-n (word can be number, too)');
46
47#line 32768 "now is the time"
48is($?POSITION, "now is the time line 32768, column 4-14", '#line n "long quoted name"');
Note: See TracBrowser for help on using the browser.