[svn:parrot] r37125 - in trunk: examples/streams t/examples

coke at svn.parrot.org coke at svn.parrot.org
Thu Mar 5 16:01:11 UTC 2009


Author: coke
Date: Thu Mar  5 16:01:09 2009
New Revision: 37125
URL: https://trac.parrot.org/parrot/changeset/37125

Log:
[t] pass t/examples/streams.t again 
 -  try to future proof with a warning in the file that it uses.

Modified:
   trunk/examples/streams/FileLines.pir
   trunk/t/examples/streams.t

Modified: trunk/examples/streams/FileLines.pir
==============================================================================
--- trunk/examples/streams/FileLines.pir	Thu Mar  5 14:03:53 2009	(r37124)
+++ trunk/examples/streams/FileLines.pir	Thu Mar  5 16:01:09 2009	(r37125)
@@ -6,6 +6,11 @@
 Stream::Lines. A counter stream creates line numbers, both are combined to
 one stream and then dumped.
 
+=head1 NOTE
+
+When updating this file, be sure to change L<t/example/streams.t>, as its
+tests rely on the content of this file
+
 =head1 FUNCTIONS
 
 =over 4

Modified: trunk/t/examples/streams.t
==============================================================================
--- trunk/t/examples/streams.t	Thu Mar  5 14:03:53 2009	(r37124)
+++ trunk/t/examples/streams.t	Thu Mar  5 16:01:09 2009	(r37125)
@@ -128,105 +128,110 @@
 read:[    6 Stream::Lines. A counter stream creates line numbers, both are combined to]
 read:[    7 one stream and then dumped.]
 read:[    8 ]
-read:[    9 =head1 FUNCTIONS]
+read:[    9 =head1 NOTE]
 read:[   10 ]
-read:[   11 =over 4]
-read:[   12 ]
-read:[   13 =item _main]
-read:[   14 ]
-read:[   15 Opens this file (or the one specified at the command line) and creates a lines]
-read:[   16 stream for it. Then it combines the stream with a stream providing line numbers.]
+read:[   11 When updating this file, be sure to change L<t/example/streams.t>, as its]
+read:[   12 tests rely on the content of this file]
+read:[   13 ]
+read:[   14 =head1 FUNCTIONS]
+read:[   15 ]
+read:[   16 =over 4]
 read:[   17 ]
-read:[   18 =cut]
+read:[   18 =item _main]
 read:[   19 ]
-read:[   20 .sub _main]
-read:[   21     .param pmc argv]
-read:[   22     .local int argc]
-read:[   23     .local pmc file]
-read:[   24     .local pmc lines]
-read:[   25     .local pmc counter]
-read:[   26     .local pmc combiner]
-read:[   27     .local string name]
-read:[   28 ]
-read:[   29     # get the name of the file to open]
-read:[   30     name = "examples/streams/FileLines.pir"]
-read:[   31     argc = argv]
-read:[   32     if argc < 2 goto NO_NAME]
-read:[   33     name = argv[1]]
-read:[   34 NO_NAME:]
-read:[   35 ]
-read:[   36     load_bytecode "library/Stream/ParrotIO.pir"]
-read:[   37     load_bytecode "library/Stream/Lines.pir"]
-read:[   38     load_bytecode "library/Stream/Sub.pir"]
-read:[   39     load_bytecode "library/Stream/Combiner.pir"]
+read:[   20 Opens this file (or the one specified at the command line) and creates a lines]
+read:[   21 stream for it. Then it combines the stream with a stream providing line numbers.]
+read:[   22 ]
+read:[   23 =cut]
+read:[   24 ]
+read:[   25 .sub _main]
+read:[   26     .param pmc argv]
+read:[   27     .local int argc]
+read:[   28     .local pmc file]
+read:[   29     .local pmc lines]
+read:[   30     .local pmc counter]
+read:[   31     .local pmc combiner]
+read:[   32     .local string name]
+read:[   33 ]
+read:[   34     # get the name of the file to open]
+read:[   35     name = \"examples/streams/FileLines.pir\"]
+read:[   36     argc = argv]
+read:[   37     if argc < 2 goto NO_NAME]
+read:[   38     name = argv[1]]
+read:[   39 NO_NAME:]
 read:[   40 ]
-read:[   41     # create a file stream]
-read:[   42     file = new "Stream::ParrotIO"]
-read:[   43     file."open"( name, 'r' )]
-read:[   44 ]
-read:[   45     # process it one line per read]
-read:[   46     lines = new "Stream::Lines"]
-read:[   47     assign lines, file]
-read:[   48 ]
-read:[   49     # endless counter]
-read:[   50     counter = new "Stream::Sub"]
-read:[   51     .const 'Sub' temp = "_counter"]
-read:[   52     assign counter, temp]
+read:[   41     load_bytecode \"library/Stream/ParrotIO.pir\"]
+read:[   42     load_bytecode \"library/Stream/Lines.pir\"]
+read:[   43     load_bytecode \"library/Stream/Sub.pir\"]
+read:[   44     load_bytecode \"library/Stream/Combiner.pir\"]
+read:[   45 ]
+read:[   46     # create a file stream]
+read:[   47     file = new \"Stream::ParrotIO\"]
+read:[   48     file.\"open\"( name, 'r' )]
+read:[   49 ]
+read:[   50     # process it one line per read]
+read:[   51     lines = new \"Stream::Lines\"]
+read:[   52     assign lines, file]
 read:[   53 ]
-read:[   54     # combine the counter and the file's lines]
-read:[   55     combiner = new "Stream::Combiner"]
-read:[   56     assign combiner, counter]
-read:[   57     assign combiner, lines]
+read:[   54     # endless counter]
+read:[   55     counter = new \"Stream::Sub\"]
+read:[   56     .const 'Sub' temp = \"_counter\"]
+read:[   57     assign counter, temp]
 read:[   58 ]
-read:[   59     # dump the stream]
-read:[   60     combiner."dump"()]
-read:[   61 ]
-read:[   62     end]
-read:[   63 .end]
-read:[   64 ]
-read:[   65 =item _counter]
+read:[   59     # combine the counter and the file's lines]
+read:[   60     combiner = new \"Stream::Combiner\"]
+read:[   61     assign combiner, counter]
+read:[   62     assign combiner, lines]
+read:[   63 ]
+read:[   64     # dump the stream]
+read:[   65     combiner.\"dump\"()]
 read:[   66 ]
-read:[   67 This sub is the source of the counter stream. It just endlessly writes]
-read:[   68 line numbers followed by a space to its stream.]
+read:[   67     end]
+read:[   68 .end]
 read:[   69 ]
-read:[   70 =cut]
+read:[   70 =item _counter]
 read:[   71 ]
-read:[   72 .sub _counter]
-read:[   73     .param pmc stream]
-read:[   74     .local int i]
-read:[   75     .local string str]
-read:[   76     .local pmc array]
-read:[   77 ]
-read:[   78     i = 0]
-read:[   79     array = new 'ResizablePMCArray']
-read:[   80 ]
-read:[   81 LOOP:]
-read:[   82     inc i]
-read:[   83     array[0] = i]
-read:[   84     sprintf str, "%5d ", array]
-read:[   85     stream."write"( str )]
-read:[   86     branch LOOP]
-read:[   87 .end]
-read:[   88 ]
-read:[   89 =back]
-read:[   90 ]
-read:[   91 =head1 AUTHOR]
-read:[   92 ]
-read:[   93 Jens Rieks E<lt>parrot at jensbeimsurfen dot deE<gt> is the author]
-read:[   94 and maintainer.]
-read:[   95 Please send patches and suggestions to the Perl 6 Internals mailing list.]
-read:[   96 ]
-read:[   97 =head1 COPYRIGHT]
-read:[   98 ]
-read:[   99 Copyright (C) 2004-2008, Parrot Foundation.]
-read:[  100 ]
-read:[  101 =cut]
-read:[  102 ]
-read:[  103 # Local Variables:]
-read:[  104 #   mode: pir]
-read:[  105 #   fill-column: 100]
-read:[  106 # End:]
-read:[  107 # vim: expandtab shiftwidth=4 ft=pir:]
+read:[   72 This sub is the source of the counter stream. It just endlessly writes]
+read:[   73 line numbers followed by a space to its stream.]
+read:[   74 ]
+read:[   75 =cut]
+read:[   76 ]
+read:[   77 .sub _counter]
+read:[   78     .param pmc stream]
+read:[   79     .local int i]
+read:[   80     .local string str]
+read:[   81     .local pmc array]
+read:[   82 ]
+read:[   83     i = 0]
+read:[   84     array = new 'ResizablePMCArray']
+read:[   85 ]
+read:[   86 LOOP:]
+read:[   87     inc i]
+read:[   88     array[0] = i]
+read:[   89     sprintf str, \"%5d \", array]
+read:[   90     stream.\"write\"( str )]
+read:[   91     branch LOOP]
+read:[   92 .end]
+read:[   93 ]
+read:[   94 =back]
+read:[   95 ]
+read:[   96 =head1 AUTHOR]
+read:[   97 ]
+read:[   98 Jens Rieks E<lt>parrot at jensbeimsurfen dot deE<gt> is the author]
+read:[   99 and maintainer.]
+read:[  100 Please send patches and suggestions to the Perl 6 Internals mailing list.]
+read:[  101 ]
+read:[  102 =head1 COPYRIGHT]
+read:[  103 ]
+read:[  104 Copyright (C) 2004-2008, Parrot Foundation.]
+read:[  105 ]
+read:[  106 =cut]
+read:[  107 ]
+read:[  108 # Local Variables:]
+read:[  109 #   mode: pir]
+read:[  110 #   fill-column: 100]
+read:[  111 # End:]
+read:[  112 # vim: expandtab shiftwidth=4 ft=pir:]
 EXP_FILELINES
 
         'ParrotIO.pir' => <<'EXP_PARROTIO',
@@ -242,20 +247,20 @@
 read:[ method, you can also assign your own ParrotIO\nPMC]
 read:[ to the stream with the C<assign> op.\n\n=cut\n\n.sub ]
 read:[_main :main\n    .local pmc stream\n\n    load_byteco]
-read:[de "library/Stream/ParrotIO.pir"\n\n    # create the]
-read:[ ParrotIO stream\n    stream = new "Stream::ParrotI]
-read:[O"\n\n    # open this file\n    stream."open"( "examp]
-read:[les/streams/ParrotIO.pir", 'r' )\n\n    # you can sp]
-read:[ecifiy a custom block size with\n    # stream."bloc]
-read:[kSize"( 10 )\n\n    # dump the stream\n    stream."du]
-read:[mp"()\n\n    end\n.end\n\n=head1 AUTHOR\n\nJens Rieks E<l]
+read:[de \"library/Stream/ParrotIO.pir\"\n\n    # create the]
+read:[ ParrotIO stream\n    stream = new \"Stream::ParrotI]
+read:[O\"\n\n    # open this file\n    stream.\"open\"( \"examp]
+read:[les/streams/ParrotIO.pir\", 'r' )\n\n    # you can sp]
+read:[ecifiy a custom block size with\n    # stream.\"bloc]
+read:[kSize\"( 10 )\n\n    # dump the stream\n    stream.\"du]
+read:[mp\"()\n\n    end\n.end\n\n=head1 AUTHOR\n\nJens Rieks E<l]
 read:[t>parrot at jensbeimsurfen dot deE<gt> is the auth]
 read:[or\nand maintainer.\nPlease send patches and suggest]
 read:[ions to the Perl 6 Internals mailing list.\n\n=head1]
-read:[ COPYRIGHT\n\nCopyright (C) 2004-2008, The Perl Foun]
-read:[dation.\n\n=cut\n\n# Local Variables:\n#   mode: pir\n# ]
-read:[  fill-column: 100\n# End:\n# vim: expandtab shiftwi]
-read:[dth=4 ft=pir:\n]
+read:[ COPYRIGHT\n\nCopyright (C) 2004-2008, Parrot Founda]
+read:[tion.\n\n=cut\n\n# Local Variables:\n#   mode: pir\n#   ]
+read:[fill-column: 100\n# End:\n# vim: expandtab shiftwidt]
+read:[h=4 ft=pir:\n]
 EXP_PARROTIO
     },
 );


More information about the parrot-commits mailing list