File: runtime-bareword-filehandles.t

package info (click to toggle)
libtest-mockfile-perl 0.037-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: perl: 4,110; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 772 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use strict;
use warnings;

use Test2::Bundle::Extended;
use Test2::Tools::Explain;
use Test2::Plugin::NoWarnings;
use Test2::Tools::Exception qw< lives >;

# This must be loaded after other modules that use open() in BEGIN
use Test::MockFile qw< nostrict >;    # specifically not "strict" to trigger the issue

# This must be loaded after Test::MockFile so we override the core functions
# that will be used in File::Find when it compiles
use File::Find ();

ok(
    lives(
        sub {
            File::Find::find(
                {
                    'wanted' => sub { 1 }
                },
                '.',
            );
        }
    ),
    'Successfully handled bareword filehandles during runtime',
);

is( "$@", '', 'No observed error' );

done_testing();