diff options
Diffstat (limited to 't')
-rw-r--r-- | t/injection.t | 17 | ||||
-rw-r--r-- | t/injection/Foo.pm | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/t/injection.t b/t/injection.t new file mode 100644 index 0000000..5e33406 --- /dev/null +++ b/t/injection.t @@ -0,0 +1,17 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use lib 't/injection'; + +no circular::require; + +eval "require('Foo; die q[bar]'); 1"; +like($@, qr/Can't locate Foo; die q\[bar\] in \@INC/, + "can't inject extra code via require"); + +eval 'require(q[Foo$bar])'; +like($@, qr/Can't locate Foo\$bar in \@INC/, + "can't inject extra code via require"); + +done_testing; diff --git a/t/injection/Foo.pm b/t/injection/Foo.pm new file mode 100644 index 0000000..336f337 --- /dev/null +++ b/t/injection/Foo.pm @@ -0,0 +1,2 @@ +package Foo; +1; |