Re: Preparing a new Test::* module

2008-04-09 Thread Thomas Klausner
Hi!

On Wed, Apr 09, 2008 at 02:49:05PM +0100, Fergal Daly wrote:
> On 09/04/2008, Gabor Szabo <[EMAIL PROTECTED]> wrote:
> > On Mon, Apr 7, 2008 at 10:14 PM, Fergal Daly <[EMAIL PROTECTED]> wrote:
> >  >  I would say put as much as possible of this outside the Test::
> >  >  namespace and then wrap in a thin Test:: wrapper. I wish I'd done this
> >  >  with Test::Deep, it's on the todo list but I'll never get around to
> >  >  it,
> >
> >
> > I am not sure how it will work out, but maybe add it to the TODO Tracker
> >  http://todo.useperl.at/ so someone will pick it up and do it for money.
> >  I'd really like to see that separated.
> 
> Since I'm not willing to pay for it, feel free to add it yourself :)

No,no, Vienna.pm will pay for it. We just need project maintainers to 
a) submit things they want to be done (including a price tag) and b) 
review the work done by implementors.



-- 
#!/usr/bin/perl  http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}


Re: Preparing a new Test::* module

2008-04-09 Thread Fergal Daly
On 09/04/2008, Gabor Szabo <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 7, 2008 at 10:14 PM, Fergal Daly <[EMAIL PROTECTED]> wrote:
>  >  I would say put as much as possible of this outside the Test::
>  >  namespace and then wrap in a thin Test:: wrapper. I wish I'd done this
>  >  with Test::Deep, it's on the todo list but I'll never get around to
>  >  it,
>
>
> I am not sure how it will work out, but maybe add it to the TODO Tracker
>  http://todo.useperl.at/ so someone will pick it up and do it for money.
>  I'd really like to see that separated.

Since I'm not willing to pay for it, feel free to add it yourself :)
(if it requires the author to do it, let me know and I will). Another
option is to give the illusion of good design and create a non-Test
module which presents only the non-Test interfaces of Test::Deep with
a dependency on Test::Deep. I'd support anyone's attempt to do that,

F

>  Gabor
>


Re: Preparing a new Test::* module

2008-04-09 Thread Gabor Szabo
On Mon, Apr 7, 2008 at 10:14 PM, Fergal Daly <[EMAIL PROTECTED]> wrote:
>  I would say put as much as possible of this outside the Test::
>  namespace and then wrap in a thin Test:: wrapper. I wish I'd done this
>  with Test::Deep, it's on the todo list but I'll never get around to
>  it,

I am not sure how it will work out, but maybe add it to the TODO Tracker
http://todo.useperl.at/ so someone will pick it up and do it for money.
I'd really like to see that separated.

Gabor


Re: Preparing a new Test::* module

2008-04-09 Thread Ovid
--- "Randy J. Ray" <[EMAIL PROTECTED]> wrote:

> > Test::Text::Format (generic interface)
> > Test::Text::Format::XML
> > Test::Text::Format::YAML
> > Test::Text::Format::Etcetera
> >
> 
> Feels a bit clumsy. I tend to dislike starting out three levels deep
> unless
> the middle level already exists, and there's no "Test::Text"
> currently.

It does feel clumsy, but it does seem to reflect what is going on.

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog - http://use.perl.org/~Ovid/journal/


Re: Preparing a new Test::* module

2008-04-07 Thread Aristotle Pagaltzis
* Randy J. Ray <[EMAIL PROTECTED]> [2008-04-07 02:00]:
> Right now, I plan on:
> 
> * XML validity against a DTD
> * XML validity against a XML schema
> * XML validity against a RelaxNG schema
> * YAML validity
> * JSON validity
> * Content testing via some combo of Test::Deep and/or built-in
>   capabilities from Test::JSON et al
> 
> This is based mostly from Ovid's post, but also from the
> realization that for these. most of the desired kinds of tests
> are the same: Does it parse? Is it valid against the spec? Is
> the content what I was expecting (allowing for acceptable
> variations in textual format)?

I’m not sure it makes so much sense to put those all together.
YAML and JSON map directly to Perl data structures, so a “schema”
test for both of them would be identical and would amount to
something like Data::FormValidator, Params::Validate and friends.

XML, on the other hand, has a much more complex data model that
does not at all map directly to a Perl data structure. XML is at
its best when it comes to documents, not data structures.

So I’m not sure it makes a whole lot of sense to mix it all up.
I also don’t think it makes a lot of sense to treat JSON and YAML
as particularly distinct, or that it makes a lot of sense to pay
any attention to their on-disk form as opposed to the resultant
in-memory data structure.

The only question that’s identical across the board is “does this
parse at all,” which in the case of XML means “is this well-
formed” but **not** “is this valid according to that schema or
DTD or grammar.”

Beyond that, the questions diverge: in the case of YAML and JSON,
you want Test::Deep/Data::FormValidator/Params::Validate/something
along those lines to operate directly on the data structure. In
the case of XML, you want to validate against some schema. The
shortcuts and conveniences you’ll want in a Test:: module differ
between those cases.

> Right now, I'm leaning towards Test::Markup. That might wind up
> the YAML guys a bit, though (which is actually a
> quite-acceptable bonus to me), possibly the JSON camp as well.

It’s definitely the wrong name. By that token, the output of
Data::Dumper is markup. I, uh, don’t think that’s right.

> So I am also considering Test::Serialization, since all of
> these amount to forms of serialization. Even (some would say
> *especially*) XML.

Indeed, XML is a serialisation format… but for a very different
kind of thing than what YAML and JSON both are serialisation
formats: DOM here, Perl data structure there.

Regards,
-- 
Aristotle Pagaltzis // 


Re: Preparing a new Test::* module

2008-04-07 Thread Fergal Daly
On 07/04/2008, Randy J. Ray <[EMAIL PROTECTED]> wrote:
> All,
>
>  Inspired by a u.p.o journal post that Ovid made (
>  http://use.perl.org/~Ovid/journal/36010), I've been working on a module that
>  will unify testing capabilities for various markup/serialization formats.
>  Right now, I plan on:
>
>  * XML validity against a DTD
>  * XML validity against a XML schema
>  * XML validity against a RelaxNG schema
>  * YAML validity
>  * JSON validity
>  * Content testing via some combo of Test::Deep and/or built-in capabilities
>  from Test::JSON et al

I would say put as much as possible of this outside the Test::
namespace and then wrap in a thin Test:: wrapper. I wish I'd done this
with Test::Deep, it's on the todo list but I'll never get around to
it,

F

>  This is based mostly from Ovid's post, but also from the realization that
>  for these. most of the desired kinds of tests are the same: Does it parse?
>  Is it valid against the spec? Is the content what I was expecting (allowing
>  for acceptable variations in textual format)?
>
>  One thing I would like advice on (besides suggestions for future features),
>  is, errr, the name. Right now, I'm leaning towards Test::Markup. That might
>  wind up the YAML guys a bit, though (which is actually a quite-acceptable
>  bonus to me), possibly the JSON camp as well. So I am also considering
>  Test::Serialization, since all of these amount to forms of serialization.
>  Even (some would say *especially*) XML.
>
>  Randy
>
> --
>  Randy J. Ray / [EMAIL PROTECTED]
>  Silicon Valley Scale Modelers: http://www.svsm.org
>  Sunnyvale, CA
>


Re: Preparing a new Test::* module

2008-04-07 Thread Elliot Shank

Randy J. Ray wrote:

On Sun, Apr 6, 2008 at 6:18 PM, Elliot Shank <[EMAIL PROTECTED]> wrote:

Test::Text::Format (generic interface)
Test::Text::Format::XML
Test::Text::Format::YAML
Test::Text::Format::Etcetera



Feels a bit clumsy. I tend to dislike starting out three levels deep unless
the middle level already exists, and there's no "Test::Text" currently.


Then I'd drop the Text part.


Re: Preparing a new Test::* module

2008-04-07 Thread Randy J. Ray
On Sun, Apr 6, 2008 at 6:18 PM, Elliot Shank <[EMAIL PROTECTED]> wrote:

> Randy J. Ray wrote:
>
> > One thing I would like advice on (besides suggestions for future
> > features),
> > is, errr, the name. Right now, I'm leaning towards Test::Markup. That
> > might
> > wind up the YAML guys a bit, though (which is actually a
> > quite-acceptable
> > bonus to me), possibly the JSON camp as well. So I am also considering
> > Test::Serialization, since all of these amount to forms of
> > serialization.
> > Even (some would say *especially*) XML.
> >
>
> Test::Text::Format (generic interface)
> Test::Text::Format::XML
> Test::Text::Format::YAML
> Test::Text::Format::Etcetera
>

Feels a bit clumsy. I tend to dislike starting out three levels deep unless
the middle level already exists, and there's no "Test::Text" currently.

Ovid, any thoughts?

Randy
-- 
Randy J. Ray / [EMAIL PROTECTED]
Silicon Valley Scale Modelers: http://www.svsm.org
Sunnyvale, CA


Re: Preparing a new Test::* module

2008-04-06 Thread Elliot Shank

Randy J. Ray wrote:

One thing I would like advice on (besides suggestions for future features),
is, errr, the name. Right now, I'm leaning towards Test::Markup. That might
wind up the YAML guys a bit, though (which is actually a quite-acceptable
bonus to me), possibly the JSON camp as well. So I am also considering
Test::Serialization, since all of these amount to forms of serialization.
Even (some would say *especially*) XML.


Test::Text::Format (generic interface)
Test::Text::Format::XML
Test::Text::Format::YAML
Test::Text::Format::Etcetera


Preparing a new Test::* module

2008-04-06 Thread Randy J. Ray
All,

Inspired by a u.p.o journal post that Ovid made (
http://use.perl.org/~Ovid/journal/36010), I've been working on a module that
will unify testing capabilities for various markup/serialization formats.
Right now, I plan on:

* XML validity against a DTD
* XML validity against a XML schema
* XML validity against a RelaxNG schema
* YAML validity
* JSON validity
* Content testing via some combo of Test::Deep and/or built-in capabilities
from Test::JSON et al

This is based mostly from Ovid's post, but also from the realization that
for these. most of the desired kinds of tests are the same: Does it parse?
Is it valid against the spec? Is the content what I was expecting (allowing
for acceptable variations in textual format)?

One thing I would like advice on (besides suggestions for future features),
is, errr, the name. Right now, I'm leaning towards Test::Markup. That might
wind up the YAML guys a bit, though (which is actually a quite-acceptable
bonus to me), possibly the JSON camp as well. So I am also considering
Test::Serialization, since all of these amount to forms of serialization.
Even (some would say *especially*) XML.

Randy
-- 
Randy J. Ray / [EMAIL PROTECTED]
Silicon Valley Scale Modelers: http://www.svsm.org
Sunnyvale, CA