File: 005_shortest_path.t

package info (click to toggle)
libsvn-notify-mirror-perl 0.04000-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 284 kB
  • sloc: perl: 1,167; makefile: 4
file content (17 lines) | stat: -r--r--r-- 532 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl 
require SVN::Notify::Mirror;
use Test::More tests => 12;

sub shortest {
    my ( $dirs, $expected ) = @_;

    is(SVN::Notify::Mirror::_shortest_path(@$dirs), $expected);
    is(SVN::Notify::Mirror::_shortest_path(reverse(@$dirs)), $expected);
}

shortest(['/foo/bar', '/foo/baz', '/foo/blargh'], '/foo');
shortest(['/foo/bar', '/foo/bar'], '/foo');
shortest(['/foo/bar'], '/foo');
shortest(['/foo/bar/a', '/foo/bar/b', '/blar/blagh'], '');
shortest(['/'], '');
shortest(['', '/foo/bar', '', '/foo/baz'], '/foo');