2000-10-04 15:33:21 +08:00
|
|
|
--TEST--
|
|
|
|
dirname test
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2000-10-04 00:48:48 +08:00
|
|
|
|
|
|
|
function check_dirname($path)
|
|
|
|
{
|
|
|
|
print "dirname($path) == " . dirname($path) . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
check_dirname("/foo/");
|
|
|
|
check_dirname("/foo");
|
|
|
|
check_dirname("/foo/bar");
|
|
|
|
check_dirname("d:\\foo\\bar.inc");
|
|
|
|
check_dirname("/");
|
|
|
|
check_dirname(".../foo");
|
|
|
|
check_dirname("./foo");
|
|
|
|
check_dirname("foobar///");
|
2000-10-04 15:33:21 +08:00
|
|
|
check_dirname("c:\foo");
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
2000-12-24 22:40:37 +08:00
|
|
|
dirname(/foo/) == /
|
|
|
|
dirname(/foo) == /
|
2000-10-04 15:33:21 +08:00
|
|
|
dirname(/foo/bar) == /foo
|
2000-12-24 22:40:37 +08:00
|
|
|
dirname(d:\foo\bar.inc) == .
|
|
|
|
dirname(/) == /
|
2000-10-04 15:33:21 +08:00
|
|
|
dirname(.../foo) == ...
|
|
|
|
dirname(./foo) == .
|
2000-12-24 22:40:37 +08:00
|
|
|
dirname(foobar///) == .
|
|
|
|
dirname(c:\foo) == .
|