Re: TAP Namespace Nonproliferation Treaty

2006-07-10 Thread Nik Clayton

Ovid wrote:

- Original Message 

From: Nik Clayton <[EMAIL PROTECTED]>



Ovid wrote:

I'm perfectly comfortable with this idea, but what I'm trying to figure

 > > out then, is the namespace for my parser.  It's a TAP parser, after all.
 > > Any suggestions?  I see that Adam has suggested a TAPx:: namespace,
 > > but there could still be competing TAPx::Parser modules. Don't know if
 > > that would bug folks, though.


TAPxParser


Thought about that, but immediately discarded it.  TAPx::OVID::Parser 

> doesn't say anything about the parser other than authorship and the
> latter is verified by glancing at the docs.  My jumping on the
> TAPx::Parser namespace is almost as bad as my taking TAP::Parser, so
> I'm just trying to figure out how to truly distinguish my (currently
> parser from others.  I suspect it will be as arbitrary as your idea, 
though :)


The problem with that is that we risk ending up with a proliferation of 
modules with odd names just to avoid namespace clashes.  See all the 
modules on CPAN with ::Simple or ::Lite suffixes, or the Email::/Mail:: 
split.  And then there's Schwern's original example, CGI.pm.


At least CPAN IDs are globally distinct.  Two authors that want to write 
a simpler parser can't clash over who gets to own TAP::Parser::Simple 
this way.


It may be unwieldy, but this is something that Java managed to solve 
with 'reverse domain' syntax for class hierarchies.


N



TAP diagnostic syntax proposal

2006-07-10 Thread Michael G Schwern

The PITA/TestBuilder2 BoF at YAPC::NA (which spent most of its time
talking about TAP) sketched out a syntax for parsable TAP diagnostics.

  not ok 2 - omg t3h sooper test!!1!
  file:foo.t
  line:45
  description: omg t3h sooper test!!1!
  got: this
  expected:that
  raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
  x-THAC0: 16

Details on the wiki.

http://perl-qa.yi.org/index.php/TAP_diagnostic_syntax


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Ovid
- Original Message 
From: Michael G Schwern <[EMAIL PROTECTED]>

> The PITA/TestBuilder2 BoF at YAPC::NA (which spent most of its time
> talking about TAP) sketched out a syntax for parsable TAP diagnostics.
>
>   not ok 2 - omg t3h sooper test!!1!
>   file:foo.t
>   line:45
>   description: omg t3h sooper test!!1!
>   got: this
>   expected:that
>   raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
>x-THAC0: 16

That syntax seems fine and easy to parse.  I have some questions, though.  

1.  I assume that "expected" and "got" must always appear together?
2.  If the diagnostic is present, what's required and what's optional?
3.  I'll wait on asking questions about the subset of YAML until more ideas are 
tossed about.

(by the way, is "not ok" and a skip directive illegal?  I assume so and it 
should be marked as a parse failure)

Cheers,
Ovid

-- If this message is a response to a question on a mailing list, please send 
follow up questions to the list.
 
Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/






Re: TAP diagnostic syntax proposal

2006-07-10 Thread Ian Langworth

These diagnostic keywords seem to blend too much into the rest of TAP. Consider:

 not ok 2 - omg t3h sooper test!!1!
 ! file:foo.t
 ! line:45
 ! description: omg t3h sooper test!!1!
 ! got: this
 ! expected:that
 ! raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
 ! x-THAC0: 16

...or some other delimiter.

Or maybe we say that any inline YAML is interpreted as a comment data
structure instead of a giant comment string, which can be used for
diagnostics:

 not ok 2 - omg t3h sooper test!!1!
 --- TAP diagnostics
 file:foo.t
 line:45
 description: omg t3h sooper test!!1!
 got: this
 expected:that
 raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
 x-THAC0: 16
 ...

On 7/10/06, Michael G Schwern <[EMAIL PROTECTED]> wrote:

The PITA/TestBuilder2 BoF at YAPC::NA (which spent most of its time
talking about TAP) sketched out a syntax for parsable TAP diagnostics.

   not ok 2 - omg t3h sooper test!!1!
   file:foo.t
   line:45
   description: omg t3h sooper test!!1!
   got: this
   expected:that
   raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
   x-THAC0: 16

Details on the wiki.

http://perl-qa.yi.org/index.php/TAP_diagnostic_syntax




--
Ian Langworth


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Pete Krawczyk
Subject: TAP diagnostic syntax proposal
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Mon, 10 Jul 2006 10:19:03 -0700

}The PITA/TestBuilder2 BoF at YAPC::NA (which spent most of its time
}talking about TAP) sketched out a syntax for parsable TAP diagnostics.
}
}   not ok 2 - omg t3h sooper test!!1!
}   file:foo.t
}   line:45
}   description: omg t3h sooper test!!1!
}   got: this
}   expected:that
}   raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
}   x-THAC0: 16

I would be concerned about "got" or "expected" including embedded 
newlines, such as:

  is($mech->content,$expected_page,"Web page content matches what's expected");

even with a delimiter such as Ian suggested.  How would this handle that?

Also, would the raw test be pre-expanded?  That is, what would raw-test 
show for this?

  is($user,"testuser$id","Test user name correctly generated");

-Pete K
-- 
Pete Krawczyk
  perl at bsod dot net




Re: TAP diagnostic syntax proposal

2006-07-10 Thread Michael G Schwern

On 7/10/06, Ian Langworth <[EMAIL PROTECTED]> wrote:

These diagnostic keywords seem to blend too much into the rest of TAP.


Look at it in a fixed-with font, if you're not already, and it might
stand out better.

Also consider that with the next gen TAP parsers, "enhanced" TAP
displays should be easier.  ie. Reading the raw TAP but with color,
emphesis, etc...



Consider:

  not ok 2 - omg t3h sooper test!!1!
  ! file:foo.t
  ! line:45
  ! description: omg t3h sooper test!!1!
  ! got: this
  ! expected:that
  ! raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
  ! x-THAC0: 16

...or some other delimiter.


I do like this idea because it makes it clearer what is and what is
not a diagnostic line, for parsing purposes, rather than "whatever
happens to parse as YAML".



Or maybe we say that any inline YAML is interpreted as a comment data
structure


*head scratch*  But if it has parsable structure its not a comment...



 instead of a giant comment string, which can be used for
diagnostics:

  not ok 2 - omg t3h sooper test!!1!
  --- TAP diagnostics
  file:foo.t
  line:45
  description: omg t3h sooper test!!1!
  got: this
  expected:that
  raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
  x-THAC0: 16


The "-- TAP" doesn't do much for me visually.  I guess I see where
you're going, making the YAML bits explicit for the parser, but where
do we stop parsing?


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Michael G Schwern

On 7/10/06, Pete Krawczyk <[EMAIL PROTECTED]> wrote:

I would be concerned about "got" or "expected" including embedded
newlines, such as:

  is($mech->content,$expected_page,"Web page content matches what's expected");

even with a delimiter such as Ian suggested.  How would this handle that?


YAML has ways to deal with newlines in values, but it does press for
some sort of "this line is part of the failure diagnostics" indicator
as Ian suggests.



Also, would the raw test be pre-expanded?  That is, what would raw-test
show for this?

  is($user,"testuser$id","Test user name correctly generated");


Ideally it would show exactly that.  The idea is to show the literal
source line (or lines) which generated the test, if possible, so the
reader can have a better idea what happened beyond what the normal
got/expected diagnostics show.  To show them with interpolated strings
would require somehow reconstructing the syntax of the function call
from inside the function.  This loses information.

Besides, they already have the expanded thing which went in.
got/expected shows that.


Re: TAP diagnostic syntax proposal

2006-07-10 Thread chromatic
On Monday 10 July 2006 10:19, Michael G Schwern wrote:

>got: this
>expected:that

"got" still sucks.  Is there any chance to change it to "received"?

-- c


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Ovid
- Original Message 
From: chromatic <[EMAIL PROTECTED]>


> On Monday 10 July 2006 10:19, Michael G Schwern wrote:
>
> >got: this
> >expected:that
>
> "got" still sucks.  Is there any chance to change it to "received"?

I like "pitched" and "caught".

  ... silence ...

*cough*

Cheers,
Ovid (for Larry's sake, no I'm not serious!)

-- If this message is a response to a question on a mailing list, please send 
follow up questions to the list.
 
Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/






Re: TAP diagnostic syntax proposal

2006-07-10 Thread David Wheeler

On Jul 10, 2006, at 11:34, chromatic wrote:


"got" still sucks.  Is there any chance to change it to "received"?


It's not a gift package delivered by FedEx. What sucks about "got"?

Best,

David


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Jonathan T. Rockway

 not ok 2 - omg t3h sooper test!!1!
 --- TAP diagnostics
 file:foo.t



Why aren't we commenting the YAML block so that it's compatible with 
current TAP parsers?  I'm thinking something like this:


not ok 2 - ensure that foo is equal to bar
# --- !!tap/diagnostics
# file: foo.t
# line: 42
# got:
#  - !!perl/foobar
#  key: value
# expected:
#  - !!perl/foobar
# key: ~
# etc: (and so on)

The commented section is raw YAML goodness, AND this format is 
compatible with current TAP parsers.  I'm liking this a lot, especially 
since I can use it Right Now (tm) by doing diag(Dump($data)).


Any reason this shouldn't be the standard? It's easy to parse, it's easy 
to read.


Would it be acecptable if I patched Test::More to start outputing it's 
expected/got messages in YAML instead of a plain text format?


Regards,
Jonathan Rockway


Re: TAP diagnostic syntax proposal

2006-07-10 Thread chromatic
On Monday 10 July 2006 11:41, David Wheeler wrote:

> It's not a gift package delivered by FedEx. What sucks about "got"?

It's the grammatical equivalent of tucking your shirt tail into your underwear 
before trying to get a date at your family reunion.

-- c


Re: TAP diagnostic syntax proposal

2006-07-10 Thread David Wheeler

On Jul 10, 2006, at 11:59, chromatic wrote:

It's the grammatical equivalent of tucking your shirt tail into  
your underwear

before trying to get a date at your family reunion.


That's the best place to *get* a date!

D


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Jonathan T. Rockway
I agree that "got" is generally a good word to avoid in formal writing, 
but in a testing protocol I think that it's an acceptable abbreviation 
for "the actual result".  Especially since "received" doesn't quite 
convey the right meaning here.  Maybe "expected data" and "actual data" 
(or "expected" and "actually") are better?  Or maybe "got" is fine; HTTP 
still works even though "Referer" is misspelled.


Has got/expected ever caused any confusion to anyone (including 
non-speakers of English)?  If so, why?



It's not a gift package delivered by FedEx. What sucks about "got"?
   



It's the grammatical equivalent of tucking your shirt tail into your underwear 
before trying to get a date at your family reunion.


-- c
 





Re: TAP diagnostic syntax proposal

2006-07-10 Thread Andy Lester


On Jul 10, 2006, at 1:38 PM, Ovid wrote:


   got: this
   expected:that


"got" still sucks.  Is there any chance to change it to "received"?


"Expected" and "actual"

--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance






Re: TAP diagnostic syntax proposal

2006-07-10 Thread Andy Lester


On Jul 10, 2006, at 2:04 PM, David Wheeler wrote:

It's the grammatical equivalent of tucking your shirt tail into  
your underwear

before trying to get a date at your family reunion.


That's the best place to *get* a date!


Actually, weddings are.  There's always someone(s) also w/o a date  
who is looking to hook up with someone, even if only for the afternoon.


--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance






Re: TAP diagnostic syntax proposal

2006-07-10 Thread Ian Langworth

prove --secret-ovid-mode ...

On 7/10/06, Ovid <[EMAIL PROTECTED]> wrote:

- Original Message 
From: chromatic <[EMAIL PROTECTED]>


> On Monday 10 July 2006 10:19, Michael G Schwern wrote:
>
> >got: this
> >expected:that
>
> "got" still sucks.  Is there any chance to change it to "received"?

I like "pitched" and "caught".

  ... silence ...

*cough*

Cheers,
Ovid (for Larry's sake, no I'm not serious!)

-- If this message is a response to a question on a mailing list, please send 
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/








--
Ian Langworth


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Ian Langworth

YAML documents [can] end with a "...".

I like Jonathan's suggestion of making the YAML comments, but my gut
feels funny about that. If the lines are preceeded with hashes, then
it's not "true" YAML; it has to be stripped of the leading characters.
Also, I'd rather have a TAP directive to state, "This is YAML,"
instead of a parser wondering if the data _is_ valid YAML.

On 7/10/06, Michael G Schwern <[EMAIL PROTECTED]> wrote:

On 7/10/06, Pete Krawczyk <[EMAIL PROTECTED]> wrote:
> I would be concerned about "got" or "expected" including embedded
> newlines, such as:
>
>   is($mech->content,$expected_page,"Web page content matches what's 
expected");
>
> even with a delimiter such as Ian suggested.  How would this handle that?

YAML has ways to deal with newlines in values, but it does press for
some sort of "this line is part of the failure diagnostics" indicator
as Ian suggests.


> Also, would the raw test be pre-expanded?  That is, what would raw-test
> show for this?
>
>   is($user,"testuser$id","Test user name correctly generated");

Ideally it would show exactly that.  The idea is to show the literal
source line (or lines) which generated the test, if possible, so the
reader can have a better idea what happened beyond what the normal
got/expected diagnostics show.  To show them with interpolated strings
would require somehow reconstructing the syntax of the function call
from inside the function.  This loses information.

Besides, they already have the expanded thing which went in.
got/expected shows that.




--
Ian Langworth


Re: TAP diagnostic syntax proposal

2006-07-10 Thread A. Pagaltzis
* Ovid <[EMAIL PROTECTED]> [2006-07-10 20:40]:
> From: chromatic <[EMAIL PROTECTED]>
> > On Monday 10 July 2006 10:19, Michael G Schwern wrote:
> >
> > >got: this
> > >expected:that
> >
> > "got" still sucks.  Is there any chance to change it to "received"?
> 
> I like "pitched" and "caught".

I’m voting for “flesh” and “spirit”.

Regards,
-- 
Aristotle
“Like punning, programming is a play on words.”
   – Alan J. Perlis, “Epigrams in Programming”


new! parrot tap parser

2006-07-10 Thread jerry gay

at the chicago hackathon, i decided to create a simple tap grammar
using perl 6 regexes. you can find the example grammar at:
   http://svn.perl.org/parrot/trunk/examples/pge/grammars/TAP.pg

that spawned interest from chris dolan on creating a parser using
parrot's parser grammar engine (pge.) today, i've committed a working
implementation of a tap parser to the parrot repository. feel free to
check it out from http://svn.perl.org/parrot/trunk/, look in
languages/tap/. there you should find a readme with a small example of
how to get it working. it's still very much a work in progress, but
i'll be happy to answer any questions you may have.

andy lester pointed me here, saying there's tapalicious discussion
going on. so, i've just signed up, to join the fun.

we're hoping to extend this tap parser to be available for use by
high-level languages implemented on parrot. of course, before this
occurs, we need to know what hlls may want to do with a tap parser
(perhaps emit xml/html/text/etc?) any uses you can think of would be
greatly appreciated.

~jerry


Re: TAP diagnostic syntax proposal

2006-07-10 Thread demerphq

On 7/10/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote:

* Ovid <[EMAIL PROTECTED]> [2006-07-10 20:40]:
> From: chromatic <[EMAIL PROTECTED]>
> > On Monday 10 July 2006 10:19, Michael G Schwern wrote:
> >
> > >got: this
> > >expected:that
> >
> > "got" still sucks.  Is there any chance to change it to "received"?
>
> I like "pitched" and "caught".

I'm voting for "flesh" and "spirit".


Ill put forward:

Have: this
Want: that

If only because they are same length.

--
perl -Mre=debug -e "/just|another|perl|hacker/"


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Paul Johnson
On Mon, Jul 10, 2006 at 11:59:27AM -0700, chromatic wrote:

> On Monday 10 July 2006 11:41, David Wheeler wrote:
> 
> > It's not a gift package delivered by FedEx. What sucks about "got"?
> 
> It's the grammatical equivalent of tucking your shirt tail into your
> underwear before trying to get a date at your family reunion.

Wonderful imagery!

Whilst I would also like to see something nicer that "got", I'm actually
more concerned about the ordering.  I always expect to see "expected"
first, followed by "got" or "received" or whatever, and I end up having
to look at the output a lot closer than I think I should in order to get
things the right way around.

But perhaps it's just my brain that's wired backwards.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


Re: TAP diagnostic syntax proposal

2006-07-10 Thread demerphq

On 7/10/06, Paul Johnson <[EMAIL PROTECTED]> wrote:

On Mon, Jul 10, 2006 at 11:59:27AM -0700, chromatic wrote:

> On Monday 10 July 2006 11:41, David Wheeler wrote:
>
> > It's not a gift package delivered by FedEx. What sucks about "got"?
>
> It's the grammatical equivalent of tucking your shirt tail into your
> underwear before trying to get a date at your family reunion.

Wonderful imagery!

Whilst I would also like to see something nicer that "got", I'm actually
more concerned about the ordering.  I always expect to see "expected"
first, followed by "got" or "received" or whatever, and I end up having
to look at the output a lot closer than I think I should in order to get
things the right way around.

But perhaps it's just my brain that's wired backwards.


If so then you aren't the only one.

I'll repeat my earlier suggestion:

Want: This
Have: That

Cheers,
Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"


Re: TAP diagnostic syntax proposal

2006-07-10 Thread chromatic
On Monday 10 July 2006 15:28, demerphq wrote:

> On 7/10/06, Paul Johnson <[EMAIL PROTECTED]> wrote:

> > Whilst I would also like to see something nicer that "got", I'm actually
> > more concerned about the ordering.  I always expect to see "expected"
> > first, followed by "got" or "received" or whatever, and I end up having
> > to look at the output a lot closer than I think I should in order to get
> > things the right way around.

> > But perhaps it's just my brain that's wired backwards.

> If so then you aren't the only one.

> I'll repeat my earlier suggestion:
>
> Want: This
> Have: That

I prefer that too.  Paul's suggestion about ordering also makes sense.

Of course, is() uses positional arguments in the opposite order.

However, if TAP is more successful than just Perl, that argument isn't very 
useful.  Besides, named arguments are nicer than positional ones.

Look, my bald yak has almost finished repainting that shed!

-- c


Re: TAP diagnostic syntax proposal

2006-07-10 Thread demerphq

On 7/11/06, chromatic <[EMAIL PROTECTED]> wrote:

On Monday 10 July 2006 15:28, demerphq wrote:

> On 7/10/06, Paul Johnson <[EMAIL PROTECTED]> wrote:

> > Whilst I would also like to see something nicer that "got", I'm actually
> > more concerned about the ordering.  I always expect to see "expected"
> > first, followed by "got" or "received" or whatever, and I end up having
> > to look at the output a lot closer than I think I should in order to get
> > things the right way around.

> > But perhaps it's just my brain that's wired backwards.

> If so then you aren't the only one.

> I'll repeat my earlier suggestion:
>
> Want: This
> Have: That

I prefer that too.  Paul's suggestion about ordering also makes sense.

Of course, is() uses positional arguments in the opposite order.


I think also that people tend to spend a lot more time staring at the
results of a failed test than they do writing the test in the first
place, so while it sucks the order is different it doesnt seem that
bad.


However, if TAP is more successful than just Perl, that argument isn't very
useful.  Besides, named arguments are nicer than positional ones.


Yeah, other implementations need not follow Test's precedent in terms
of interface.

cheers,
Yves


--
perl -Mre=debug -e "/just|another|perl|hacker/"


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Joe McMahon

Want: This
Have: That


Put me down for this one too. Simpler for non-English speakers as well.


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Randy W. Sims

chromatic wrote:

On Monday 10 July 2006 10:19, Michael G Schwern wrote:


   got: this
   expected:that


"got" still sucks.  Is there any chance to change it to "received"?


returned?



Re: TAP diagnostic syntax proposal

2006-07-10 Thread A. Pagaltzis
* Randy W. Sims <[EMAIL PROTECTED]> [2006-07-11 01:40]:
> chromatic wrote:
> >On Monday 10 July 2006 10:19, Michael G Schwern wrote:
> >
> >>   got: this
> >>   expected:that
> >
> >"got" still sucks.  Is there any chance to change it to "received"?
> 
> returned?

Err, it’s what was passed, not what was returned.

Regards,
-- 
Aristotle Pagaltzis // 


Re: TAP diagnostic syntax proposal

2006-07-10 Thread Randy W. Sims

Michael G Schwern wrote:

The PITA/TestBuilder2 BoF at YAPC::NA (which spent most of its time
talking about TAP) sketched out a syntax for parsable TAP diagnostics.

  not ok 2 - omg t3h sooper test!!1!
  file:foo.t
  line:45
  description: omg t3h sooper test!!1!
  got: this
  expected:that
  raw-test:is( "this", "that", "omg t3h sooper test!!1!" );
  x-THAC0: 16

Details on the wiki.

http://perl-qa.yi.org/index.php/TAP_diagnostic_syntax


Is 'got' and 'expected' going to return compound YAML when given 
objects? or stringified results? That would affect the complexity of the 
YAML subset you're going to support, right?


What output does C return?

Randy.



Re: Anyone experiencing problems with rt.cpan.org?

2006-07-10 Thread Ask Bjoern Hansen

Ovid wrote:


In the last day or so, every time I go to rt.cpan.org, it seems to
 nearly finish loading a page and then just stalls.





My problem was that I couldn't even log in yesterday.  I eventually
filed a bug report with perlbug-admin at perl and Robert had to
diddle the  database to get me sorted.


Wasn't that rt._perl_.org?

To the original poster: Posting about problems with a cpan.org or 
perl.org on a random-ish list or (worse) on use.perl or perlmonks is 
never the best way to get it resolved.



 - ask