File: no-clobber-globals.t

package info (click to toggle)
libtest-deep-perl 1.205-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 620 kB
  • sloc: perl: 2,413; makefile: 9
file content (35 lines) | stat: -rw-r--r-- 527 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
33
34
35
use strict;
use warnings;
use lib 't/lib';

use Test::Deep;
use Test::More 0.88;

{
  $@ = 'hello';
  any(123);
  is($@, 'hello', q{dynamically loaded test doesn't overwrite $@} );
}

{
  $! = 11;
  all(123);
  is( 0 + $!, 11, q{dynamically loaded test doesn't overwrite $!} );
}

{
  $^E = 11;
  re(qr{a});
  is( 0 + $^E, 11, q{dynamically loaded test doesn't overwrite $^E} );
}

{
  $@ = 'hello';
  cmp_deeply(
    'hello',
    str($@),
    'when passing $@ to str() it is not localized away from new'
  );
}

done_testing;