File: 01_basic.t

package info (click to toggle)
libcwd-guard-perl 0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 104 kB
  • ctags: 5
  • sloc: perl: 30; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (3)
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
use strict;
use Test::More;

use Cwd::Guard qw/cwd_guard/;
use Cwd qw/getcwd/;
use File::Basename;


my $dir = getcwd();
{
    my $guard = cwd_guard( dirname(__FILE__) );
    ok($guard);
    isnt( $dir, getcwd() );
}

is($dir, getcwd() );

{
    my $guard = cwd_guard( __FILE__ ); # fail
    ok(!$guard);
    ok($Cwd::Guard::Error);
}

done_testing();