# Copyright (c) 2005-2007 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: FilePath.bunit,v 1.20 2011/02/02 22:50:35 nagler Exp $ Type(); [ class() => [ from_literal => [ '/////////' => '/', '/a' => '/a', '/a ' => '/a', ' a ' => '/a', '/a/' => '/a', '/a/b' => '/a/b', '/a////b' => '/a/b', '/a////b////' => '/a/b', 'a:b' => FILE_PATH(), '/.' => FILE_PATH(), '.' => FILE_PATH(), '.a' => '/.a', 'a.' => '/a.', 'a/.' => FILE_PATH(), 'a/a.' => '/a/a.', '' => UNDEF(), ], join => [ [] => '', '/' => '/', ['a', 'b'] => 'a/b', ['/a', '/b'] => '/a/b', ['/a/', '/b'] => '/a/b', ], get_tail => [ '/a' => 'a', '/a/' => 'a', '/' => '', [undef] => '', '/abc/d.txt' => 'd.txt', '\\abc\\d &e' => 'd &e', ], get_clean_tail => [ '/abc/d.txt' => 'd.txt', '/abc/d;1.txt' => 'd-1.txt', ], get_versionless_tail => [ '/abc/d.txt' => 'd.txt', '/abc/d1.txt' => 'd1.txt', '/abc/d;1.txt' => 'd.txt', ], get_base => [ '/a.gif' => 'a', '.gif' => '.gif', 'a.very-long-suffix' => 'a', ], get_clean_base => [ a => 'a', 'b/a' => 'a', '/a.b' => 'a', '/.a' => 'a', 'a.b.c' => 'a.b', 'a b' => 'a-b', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ], get_suffix => [ 'a.x' => 'x', '/a.x' => 'x', 'a' => '', '/a' => '', '/.' => '', '.' => '', '..' => '', '/..' => '', '/.x' => '', '.x' => '', 'aaa.very-long-suffix' => 'very-long-suffix', '/b.c/a' => '', ], to_public => [ 'a' => '/Public/a', [undef] => '/Public', '' => '/Public', '/Public' => '/Public', '/public' => '/Public', '/public/foo' => '/Public/foo', '/public/foo' => '/Public/foo', '/public/foo' => '/Public/foo', '/Archived/foo' => '/Archived/Public/foo', ], from_public => [ '/Public' => '/', '/public' => '/', '/public/Foo' => '/Foo', '/Archived/public/Foo' => '/Archived/Foo', '/a' => '/a', [undef] => '/' ], is_public => [ [undef] => 0, '/Public' => 1, '/Public/' => 1, '/' => 0, '/public/x' => 1, ], to_absolute => [ ['foo.txt', 0] => 'foo.txt', ['bar.txt', 1] => '/Public/bar.txt', ['foo;1.txt', 0] => '/Archived/foo;1.txt', ['bar;1.txt', 1] => '/Archived/Public/bar;1.txt', ['foo;0.1.txt', 0] => '/Archived/foo;0.1.txt', ['bar;1.1.txt', 1] => '/Archived/Public/bar;1.1.txt', ], delete_suffix => [ [undef] => [undef], '' => '', 'a.html' => 'a', '.html' => '.html', ], ], ];