File: exclude_test_symbols.t

package info (click to toggle)
libtest-most-perl 0.38-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 543; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/perl

use lib 'lib', 't/lib';

BEGIN {
    package t::Fake;
    use Exporter 'import';
    our @EXPORT = 'any';
    our @EXPORT_OK = 'any';
    $INC{'t/Fake.pm'} => 1;
    # Test::Deep's any() returns a Test::Deep::Any object
    sub any { 1; }
}

use Test::Most tests => 5, '!any';
use OurTester qw($DIED dies);
t::Fake->import;

ok 1, 'Normal calls to ok() should succeed';
is 2, 2, '... as should all passing tests';
cmp_deeply [ 3, 4 ], [ 3, 4 ], '... and Test::Deep tests';
ok !ref(any('foo')), "... but any() calls our version, not Test::Deep's";

ok !(grep { $_ eq 'any' } @Test::Most::EXPORT), 'and "any" is not in our @EXPORT';