Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found