File: 08-exists.t

package info (click to toggle)
libdirectory-scratch-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 404 kB
  • ctags: 25
  • sloc: perl: 1,173; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 441 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
#!/usr/bin/perl
# 08-exists.t 
# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>

use Directory::Scratch;
use Test::More tests=>7;
use strict;
use warnings;

my $t    = Directory::Scratch->new;
my $base = $t->base;

ok(!$t->exists('foo/bar'));
ok(!$t->exists('foo'));
ok(!$t->exists('bar'));

my $foobar = $t->touch('foo/bar');
ok($foobar);
is($t->exists('foo/bar'), $foobar);
ok($t->exists('foo'));
ok($t->exists('foo') =~ /foo$/);