File: 01-basics.t

package info (click to toggle)
libtainting-perl 0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 120 kB
  • ctags: 3
  • sloc: perl: 126; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (4)
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
#!perl

use Module::Load;
use Test::More 0.98;
use Test::Exception;

sub use_ {
    my $mod = shift;
    load $mod;
    if (@_) {
        $mod->import(@_);
    } else {
        $mod->import;
    }
}

sub no_ {
    my $mod = shift;
    $mod->unimport;
}

dies_ok  { use_ "tainting"; system "true" }
    "tainting is turned on lexically";
lives_ok { use_ "tainting"; { no_ "tainting"; system "true" } }
    "tainting is turned off lexically";

done_testing;