Steffen Schwigon > Test-TAPv13 > Test::TAPv13

Download:
Test-TAPv13-0.002.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.002   Source  

NAME ^

Test::TAPv13 - provide TAP v13 support to test scripts

SYNOPSIS ^

  use Test::TAPv13 ':all'; # before other Test::* modules
  use Test::More tests => 2;
  
  my $data = { affe => { tiger => 111,
                         birne => "amazing",
                         loewe => [ qw( one two three) ],
               },
               zomtec => "here's another one",
  };
  
  ok(1, "hot stuff");
  tap13_yaml($data);
  tap13_pragma "+strict";
  ok(1, "more hot stuff");

This would create TAP like this:

  TAP version 13
  1..2
  ok 1 - hot stuff
    ---
    affe:
      birne: amazing
      loewe:
        - one
        - two
        - three
      tiger: 111
    zomtec: 'here''s another one'
    ...
  pragma +strict
  ok 2 - more hot stuff

tap13_yaml($data)

For example

  tap13_yaml($data);

prints out an indented YAML block of the data, like this:

    ---
    affe:
      birne: amazing
      kram:
        - one
        - two
        - three
      one: 111
    zomtec: "here's another one"
    ...

To make it meaningful, e.g. in a TAP::DOM, you should do that directly after an actual test line to which this data block will belong as a child.

tap13_pragma($string)

For example

  tap13_pragma("+strict");

prints out a TAP pragma line:

  pragma +strict

You most probably do not want or need this, but anyway, the +strict pragma is part of the TAP v13 specification and makes the TAP parser fail on non-TAP (unknown) lines.

tap13_version

Not to be called directly in your scripts as it is called implicitely as soon you use Test::TAP13.

Prints out the version statement

  TAP version 13

ABOUT ^

This module is to utilize TAP version 13 features in your test scripts.

TAP, the Test Anything Protocol, allows some new elements beginning with version 13. The most prominent one is to embed data as indented YAML blocks.

This module automatically declares TAP version 13 first in the TAP stream which is needed to tell the TAP::Parser to actually parse those new features. With some utility functions you can then actually include data, etc.

AUTHOR ^

Steffen Schwigon <ss5@renormalist.net>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Steffen Schwigon.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: