logo       

Re: TAP 2.0: msg#00092

Subject: Re: TAP 2.0
Jonathan Rockway wrote:
> I like the "YAML" syntax, but can we live with:
> 
> got: |
>  this is line 1
>  this is line 2
> expected: |
>  this is line 1
>  this is line 2
> 
> Instead?  That way a real YAML parser can parse the output of TAP, which
> could be important for adoption by other languages.  Rather than require
> others to write a TAP parser, we can just tell them to use their YAML
> parser in streaming mode.   Since we aren't using *all* the features of
> YAML here, we can still have a light implementation for Perl.  (Not that
> I'm against using a full YAML parser... but I think others are :)

I'm with Jonathan here.  If we can stick to a subset of an existing format 
without extending it life for TAP implementors will be much easier.  They can 
use something off the shelf.  TAP producers have a wide range of formats to use 
to best fit their data.

For example, if we want to represent C<got => "foo\nbar\nbaz\n"> we can do:

got: |
  foo
  bar
  baz

but when there's leading whitespace we get into trouble, such as C<got => "  
foo\nbar\nbaz">

# invalid YAML
got: |
    foo
  bar
  baz


That's not valid YAML, all lines in the scalar value block have to be indented 
as far as the leading line.  But that's ok, you can give an explicit 
indentation level:

got: |2
    foo
  bar
  baz

And then there's a ton of other scalar value formats which can be used....

# got => "foo"
got: foo

# got => "  foo"
got: "  foo"

# got => "  foo  "
got: '  foo  '

# got => "foo\nbar\nbaz\n"
got: "foo\nbar\nbaz\n"

# got => "There's a really long string here which doesn't contain any newlines 
in it but..."
got: >
  There's a really long string here which doesn't contain any
  newlines in it but its nice to soft wrap it for easier reading
  without actually putting any newlines into the resulting data.

# got => qq[This literal block has\nno trailing newline.\nIt is "chomped".]
got: |-
  This literal block has
  no trailing newline.
  It is "chomped".

got:
  While this is valid YAML,
  YAML.pm does not support it
  so I'm not entirely sure
  what it does.


YAML also has the benefit of being a nearly complete functional superset of 
JSON so TAP producers can output their diagnostics as JSON if they like and we 
can parse it for free.
http://redhanded.hobix.com/inspect/yamlIsJson.html



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe