File: slice.t

package info (click to toggle)
libfile-fu-perl 0.0.7-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 244 kB
  • ctags: 165
  • sloc: perl: 1,421; makefile: 2
file content (18 lines) | stat: -rwxr-xr-x 357 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use warnings;
use strict;

use Test::More qw{no_plan};

use File::Fu;

my $dir = File::Fu->dir('foo/bar/baz/bort/');
is($dir->slice(0,3), 'foo/bar/baz/bort/');
is($dir->slice(0,-1), 'foo/bar/baz/bort/');
is($dir->slice(0,-2), 'foo/bar/baz/');
is($dir->slice(0,-3), 'foo/bar/');
is($dir->slice(-2,-1), 'baz/bort/');


# vim:ts=2:sw=2:et:sta