File: 08_prune.t

package info (click to toggle)
liborlite-perl 1.97-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 524 kB
  • sloc: perl: 3,693; sql: 97; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (5)
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
36
37
38
39
40
#!/usr/bin/perl

# Test the { prune => 1 } feature of ORLite

use strict;

BEGIN {
	$|  = 1;
	$^W = 1;
}

use Test::More tests => 7;
use Test::Script;
use File::Remove;
use t::lib::Test;

# Where the test file will be
my $file = test_db();
ok( ! -f $file, 'File does not exist' );

# Run the test program WITHOUT prune
script_runs( [
	't/08_prune.pl',
	file   => $file,
	create => 1,
], '08_prune.pl without prune ran ok' );
ok( -f $file, '08_prune.pl without prune created the file as expected' );

# Clean up
ok( File::Remove::remove($file), 'Removed the test file' );
ok( ! -f $file, 'Removed test file' );

# Run the test program again WITH prune
script_runs( [
	't/08_prune.pl',
	file   => $file,
	create => 1,
	prune  => 1,
], '08_prune.pl with prune ran ok' );
ok( ! -f $file, '08_prune.pl with prune removed the file' );