use a plan instead of done_testing in TODO test
[p5sagit/Try-Tiny.git] / t / given_when.t
CommitLineData
1a2992bb 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
8BEGIN {
9 plan skip_all => "Perl 5.10 is required" unless eval { require 5.010 };
68d55f6d 10 plan tests => 3;
e1e2d16a 11 use_ok("Try::Tiny");
1a2992bb 12}
13
1a2992bb 14my ( $error, $topic );
15
16given ("foo") {
17 when (qr/./) {
18 try {
19 die "blah\n";
20 } catch {
21 $topic = $_;
22 $error = $_[0];
23 }
24 };
25}
26
27is( $error, "blah\n", "error caught" );
28
29{
30 local $TODO = "perhaps a workaround can be found";
31 is( $topic, $error, 'error is also in $_' );
32}
33
1a2992bb 34# ex: set sw=4 et:
35