summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-11-14 16:47:30 -0600
committerJesse Luehrs <doy@tozt.net>2010-11-14 16:47:30 -0600
commit68cb1ade6177987a8950e4cb3050c1139e802fee (patch)
treeda58353394fc75776ed27ee619ab8b22482fd2e0 /t
parentfe890fb97648df1253becf110e4e4dfa3c2c8015 (diff)
downloadeval-closure-68cb1ade6177987a8950e4cb3050c1139e802fee.tar.gz
eval-closure-68cb1ade6177987a8950e4cb3050c1139e802fee.zip
Revert "use Devel::Hints where possible"0.01
This reverts commit fe890fb97648df1253becf110e4e4dfa3c2c8015. "meh", this is a lot of effort for very little real gain
Diffstat (limited to 't')
-rw-r--r--t/03-description.t2
-rw-r--r--t/05-memoize.t27
-rw-r--r--t/11-line-differences.t61
3 files changed, 6 insertions, 84 deletions
diff --git a/t/03-description.t b/t/03-description.t
index c9e8b21..97f8372 100644
--- a/t/03-description.t
+++ b/t/03-description.t
@@ -32,7 +32,7 @@ SOURCE
like(
exception { $code->() },
- qr/^foo at accessor foo \(defined at Class\.pm line 282\) line 1\n/,
+ qr/^foo at accessor foo \(defined at Class\.pm line 282\) line 2\n/,
"description is set"
);
}
diff --git a/t/05-memoize.t b/t/05-memoize.t
index e4b582b..02fd11f 100644
--- a/t/05-memoize.t
+++ b/t/05-memoize.t
@@ -8,12 +8,7 @@ use Test::Requires 'Test::Output';
use Eval::Closure;
{
- my $source = <<'SOURCE';
- sub {
- $foo * 2;
- };
- BEGIN { warn "foo\n" }
-SOURCE
+ my $source = 'BEGIN { warn "foo\n" } sub { $foo * 2 }';
my $code;
my $bar = 15;
@@ -43,12 +38,7 @@ SOURCE
}
{
- my $source = <<'SOURCE';
- sub {
- $bar * 2;
- };
- BEGIN { warn "bar\n" }
-SOURCE
+ my $source = 'BEGIN { warn "bar\n" } sub { $bar * 2 }';
my $code;
my $foo = 60;
@@ -66,8 +56,7 @@ SOURCE
my $code2;
my $baz = 23;
- { local $TODO = $] < 5.010 ? "description breaks memoization on 5.8"
- : undef;
+ { local $TODO = "description breaks memoization";
stderr_is {
$code2 = eval_closure(
source => $source,
@@ -83,12 +72,7 @@ SOURCE
}
{
- my $source = <<'SOURCE';
- sub {
- Carp::confess "baz";
- };
- BEGIN { warn "baz\n" }
-SOURCE
+ my $source = 'BEGIN { warn "baz\n" } sub { Carp::confess "baz" }';
my $code;
stderr_is {
@@ -102,8 +86,7 @@ SOURCE
"got the right description");
my $code2;
- { local $TODO = $] < 5.010 ? "description breaks memoization on 5.8"
- : undef;
+ { local $TODO = "description breaks memoization";
stderr_is {
$code2 = eval_closure(
source => $source,
diff --git a/t/11-line-differences.t b/t/11-line-differences.t
deleted file mode 100644
index 4dd3625..0000000
--- a/t/11-line-differences.t
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use Test::More;
-use Test::Requires 'Test::Output';
-
-use Eval::Closure;
-
-{
- my $code = eval_closure(
- source => 'sub { warn "foo" }',
- description => 'bar',
- );
- { local $TODO = $] < 5.010 ? "line numbers from #line are slightly different" : undef;
- stderr_is { $code->() } "foo at bar line 1.\n", "got the right line";
- }
-}
-
-{
- my $code = eval_closure(
- source => <<'SOURCE',
- sub {
-
- warn "foo";
-
- }
-SOURCE
- description => 'bar',
- );
- { local $TODO = $] < 5.010 ? "line numbers from #line are slightly different" : undef;
- stderr_is { $code->() } "foo at bar line 1.\n", "got the right line";
- }
-}
-
-{
- my $code = eval_closure(
- source => <<'SOURCE',
-
- sub {
- warn "foo";
- }
-SOURCE
- description => 'bar',
- );
- { local $TODO = $] < 5.010 ? "line numbers from #line are slightly different" : undef;
- stderr_is { $code->() } "foo at bar line 1.\n", "got the right line";
- }
-}
-
-{
- my $code = eval_closure(
- source => '$sub',
- environment => { '$sub' => \sub { warn "foo" } },
- description => 'bar',
- );
- { local $TODO = $] < 5.010 ? "#line can't adjust line numbers inside non-evaled subs" : undef;
- stderr_is { $code->() } "foo at bar line 1.\n", "got the right line";
- }
-}
-
-done_testing;