root/t/syntax/POD.t

Revision 20490, 1.3 kB (checked in by Auzon, 8 months ago)

s/use v6-alpha;$/use v6;/;
Also catching a few other mentions of v6-alpha.

  • 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 5;
6
7# See "=begin DATA" at the end of file.
8
9# L<S02/Literals/filehandle "named as" %=POD{'DATA'}>
10{
11    ok %=POD{'DATA'}, '=begin DATA works and %=POD<DATA> defined';
12
13    my $line = =%=POD<DATA>;
14    is($line, "hello, world!", q/%=POD{'DATA'} can be read/);
15}
16
17# L<S02/Literals/"pod stream" "as a scalar" via $=DATA>
18{
19    my $line = =$=DATA;
20    is($line, "hello, world!", q/$=DATA contains the right string/);
21}
22
23# L<S02/Literals/"pod stream" "as an array" via @=DATA>
24{
25    is @=DATA.elems, 1, '@=DATA contains a single elem';
26    is @=DATA[0], "hello, world!\n", '@=DATA[0] contains the right value';
27}
28
29# The following commented-out tests are currnetly unspecified:
30# others will be added later, or you can do it.
31
32#ok eval('
33#=begin DATA LABEL1
34#LABEL1.1
35#LABEL1.2
36#LABEL1.3
37#=end DATA
38
39#=begin DATA LABEL2
40#LABEL2.1
41#LABEL2.2
42#=end DATA
43#'), "=begin DATA works", :todo;
44
45#is(eval('%=DATA<LABEL1>[0]'), 'LABEL1.1', '@=DATA<LABEL1>[0] is correct', :todo);
46#is(eval('%=DATA<LABEL1>[2]'), 'LABEL1.3', '@=DATA<LABEL1>[2] is correct', :todo);
47#is(eval('~ %=DATA<LABEL1>'), 'LABEL1.1LABEL1.2LABEL1.3', '~ %=DATA<LABEL1> is correct', :todo);
48
49#is(eval('~ $=LABEL2'), 'LABEL2.1LABEL2.2', '~ $=LABEL2 is correct', :todo);
50#is(eval('$=LABEL2[1]'), 'LABEL2.2', '$=LABEL2[1] is correct', :todo);
51
52=begin DATA
53hello, world!
54=end DATA
Note: See TracBrowser for help on using the browser.