On Sun, Jan 13, 2008 at 11:35:17PM +0100, Cosimo Streppone wrote:
> - Are smartlinks "stackable?"
>   That is, can I refer the same code to multiple links?
>   http://perlsix.org/svn/pugs/revision?rev=19471

According to the documentation in smartlinks.pl, they are.
See http://svn.pugscode.org/pugs/util/smartlinks.pl .

> - Is [1] the correct way of declaring "todo" tests?
>   What's the equivalent in new compiler directives
>   of `:todo<feature>', `:todo<bug>', and ':todo'?
> [1] t/spec/S29-str/quotemeta.t

Larry, Jerry, and I discussed this a couple of weeks ago
and here's my vision for how it should work.  To simplify
things, let's break it into two parts:  (1) how to mark tests
as 'todo', and (2) how to do this for specific implementations.

For the first part, we identify a test function that looks like

    sub todo($reason, $count=1) { ... }

Calling C<< todo('foo', 3); >> says that the next three tests are
to be marked as TODO with 'foo' given as a reason.  

Secondly, to indicate that a function should be invoked only
in specific compiler implementations, we propose a compiler or
preprocessor syntax that looks like:

    #?perl6: fn(args);

The "perl6" compiler will treat this as a valid function call,
all other implementations will view the line as a comment.

This is not yet intended to be the required behavior for all
compiler implementations -- it's just the approach that Perl 6
on Parrot will be using for now.  We'll try it and see how
it works.

To return to the example given:

    #?pugs: todo('Test Config.pm availability', 1);
    is('Config.pm', 'available', 'Config.pm availability');

This looks good to me -- this says that the Config.pm
test is being marked as todo only for Pugs (if Pugs chooses
to implement this behavior).  Compilers other than Pugs
will simply see the #?pugs: line as a normal comment, and
therefore will not treat the test as being 'todo'.

We also have a syntax for handling 'skip' blocks and text.
For perl6 on Parrot, the syntax will be:

    #?perl6: skip('Foo', 3);  #SKIPBLOCK
    {
        isnt('foo', 'bar', 'foo is not bar');
        isnt('bar', 'foo', 'bar is not foo');
        is('foo', 'bar', 'foo is bar');
    }

The presence of #SKIPBLOCK at the end of a #?perl6 line means to
generate "skip" results for the next three tests, and to skip over
the next brace-delimited "block".  The braces must be at the
beginning of source lines.  Anything between the braces is
ignored by the compiler at runtime, either because it skips
over the "block" or because a preprocessor has stripped it
somehow.

Hope this helps,

Pm

Reply via email to