# -*- perl -*-
use lib qw(t lib);
use strict;
use TestBackup;
use File::Backup;
    
plan test => 11;

makefile('a');

my $name = backup('a',BACKUP_NONE);
ok(!defined($name));

$name = backup('a',BACKUP_SIMPLE);
ok($name, 'a~');
fileok('a', $name);

$name = backup('a',BACKUP_AUTO);
ok($name, 'a~');
fileok('a', $name);

$name = backup('a',BACKUP_NUMBERED);
ok($name, 'a.~1~');
fileok('a', $name);

$name = backup('a',BACKUP_AUTO);
ok($name, 'a.~2~');
fileok('a', $name);

$name = backup('a');
ok($name, 'a.~3~');
fileok('a', $name);
