The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Test::NameNote - add notes to test names

SYNOPSIS

Adds notes to test names in Test::Builder-based test scripts.

  use Test::More tests => 10;
  use Test::NameNote;

  ok foo(), "foo true";
  foreach my $foo (0, 1) {
      my $n1 = Test::NameNote->new("foo=$foo");
      foreach my $bar (0, 1) {
          my $n2 = Test::NameNote->new("bar=$bar");
          is thing($foo, $bar), "thing", "thing returns thing";
          is thang($foo, $bar), "thang", "thang returns thang";
      }
  }
  ok bar(), "bar true";

  # prints:
  1..10
  ok 1 - foo true
  ok 2 - thing returns thing (foo=0,bar=0)
  ok 3 - thang returns thang (foo=0,bar=0)
  ok 4 - thing returns thing (foo=0,bar=1)
  ok 5 - thang returns thang (foo=0,bar=1)
  ok 6 - thing returns thing (foo=1,bar=0)
  ok 7 - thang returns thang (foo=1,bar=0)
  ok 8 - thing returns thing (foo=1,bar=1)
  ok 9 - thang returns thang (foo=1,bar=1)
  ok 10 - bar true

CONSTRUCTORS

new ( NOTE )

Builds a new Test::NameNote object for the specifed NOTE text. The note will be added to the names of all Test::Builder tests run while the object is in scope.

AUTHOR

Nick Cleaton, <nick at cleaton dot net>

COPYRIGHT & LICENSE

Copyright 2009 Nick Cleaton, all rights reserved.

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