aboutsummaryrefslogtreecommitdiff
path: root/t/04envar.t
blob: f87f355de92244b5f9fec018d6b32398a3bcb6e7 (plain)
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
# -*- perl -*-
use lib qw(t lib);
use strict;
use TestBackup;
use File::Backup;
    
plan test => 16;

makefile('a');

sub test_envar {
    my ($val, $exp) = @_;
    $ENV{VERSION_CONTROL} = $val;
    my $name = backup('a');
    if (defined($exp)) {
	ok($name,$exp);
	fileok($name,'a');
    } else {
	ok(!defined($name));
    }
}

test_envar 'none';
test_envar 'off';
test_envar 'never', 'a~';
test_envar 'simple', 'a~';
test_envar 'numbered', 'a.~1~';
test_envar 't', 'a.~2~';
test_envar 'nil', 'a.~3~';
test_envar 'existing', 'a.~4~';
unlink qw(a.~1~ a.~2~ a.~3~ a.~4~);
test_envar 'existing', 'a~';

Return to:

Send suggestions and report system problems to the System administrator.