A short guide to adding tests is in order, because if you report a bug, the standard reply will be "write a test for it".

There's currently a bug in Pugs that makes array references flatten in list context. A bug test is simple: write what you did and what you expected first:

# What I did my @foo; push @foo, []; # What I expected @foo.elems == 1 # But I got @foo.elems == 0
Then, rewrite the expectation as a test:
ok(@foo.elems == 1, "\@foo has 1 element");
If you're dealing with comparison, it's better to use is() instead of ok(), because you then get extra debugging output:
is(@foo.elems, 1, "\@foo has 1 element");
Add enough stuff to make it a script (the "plan" is the number of tests in the test script), and make sure you're loading the Test module:
#!/usr/bin/pugs use v6; use Test; plan 1; my @foo; push @foo, []; is(@foo.elems, 1, "\@foo has 1 element");
And then report your bug-report-test to a pugs developer, so that it can be included in the test suite. It'll remain there for a long time, to make sure that the bug, once fixed, won't come back (regress).

If you have write access in the repository, commit the test as pugs/t/pugsbugs/foo.t, where foo is descriptive (in this case, the test is in flattening.t). If you will be reporting multiple bugs, request committer access from Autrijus. Giving you access once is easier than copying and pasting every bug report test.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }


In reply to Re: Get Involved With Pugs by Juerd
in thread Get Involved With Pugs by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.