File: 20registrations.t

package info (click to toggle)
libxs-parse-sublike-perl 0.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 516 kB
  • sloc: ansic: 944; perl: 930; sh: 6; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 452 bytes parent folder | download
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
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

use lib "t";
use testcase "t::registrations";

# Check the individual `func` registrations do not clash
{
   {
      BEGIN { $^H{"t::registrations/red"} = 1 }
      func returns_red { }
   }
   {
      BEGIN { $^H{"t::registrations/blue"} = 1 }
      func returns_blue { }
   }

   is( returns_red(),  "red",  'returns red' );
   is( returns_blue(), "blue", 'returns blue' );
}

done_testing;