1#!/usr/bin/ksh 2 3if [ `basename "/foo/bar/baz"` != "baz" ]; then 4 echo "basename(\"/foo/bar/baz\") is \"baz\"; expected \"`basename "/foo/bar/baz"`"\" 5fi 6 7if [ `dirname "/foo/bar/baz"` != "/foo/bar" ]; then 8 echo "dirname(\"/foo/bar/baz\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz"`"\" 9fi 10 11if [ `basename "/foo/bar///baz/"` != "baz" ]; then 12 echo "basename(\"/foo/bar///baz/\") is \"baz\"; expected \"`basename "/foo/bar///baz/"`"\" 13fi 14 15if [ `dirname "/foo/bar///baz/"` != "/foo/bar" ]; then 16 echo "dirname(\"/foo/bar///baz/\") is \"/foo/bar\"; expected \"`dirname "/foo/bar///baz/"`"\" 17fi 18 19if [ `basename "/foo/bar/baz/"` != "baz" ]; then 20 echo "basename(\"/foo/bar/baz/\") is \"baz\"; expected \"`basename "/foo/bar/baz/"`"\" 21fi 22 23if [ `dirname "/foo/bar/baz/"` != "/foo/bar" ]; then 24 echo "dirname(\"/foo/bar/baz/\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz/"`"\" 25fi 26 27if [ `basename "/foo/bar/baz//"` != "baz" ]; then 28 echo "basename(\"/foo/bar/baz//\") is \"baz\"; expected \"`basename "/foo/bar/baz//"`"\" 29fi 30 31if [ `dirname "/foo/bar/baz//"` != "/foo/bar" ]; then 32 echo "dirname(\"/foo/bar/baz//\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz//"`"\" 33fi 34 35if [ `basename "/foo/bar/baz/."` != "." ]; then 36 echo "basename(\"/foo/bar/baz/.\") is \".\"; expected \"`basename "/foo/bar/baz/."`"\" 37fi 38 39if [ `dirname "/foo/bar/baz/."` != "/foo/bar/baz" ]; then 40 echo "dirname(\"/foo/bar/baz/.\") is \"/foo/bar/baz\"; expected \"`dirname "/foo/bar/baz/."`"\" 41fi 42 43if [ `basename "/foo/bar/baz/./"` != "." ]; then 44 echo "basename(\"/foo/bar/baz/./\") is \".\"; expected \"`basename "/foo/bar/baz/./"`"\" 45fi 46 47if [ `dirname "/foo/bar/baz/./"` != "/foo/bar/baz" ]; then 48 echo "dirname(\"/foo/bar/baz/./\") is \"/foo/bar/baz\"; expected \"`dirname "/foo/bar/baz/./"`"\" 49fi 50 51if [ `basename "/foo/bar/baz/.//"` != "." ]; then 52 echo "basename(\"/foo/bar/baz/.//\") is \".\"; expected \"`basename "/foo/bar/baz/.//"`"\" 53fi 54 55if [ `dirname "/foo/bar/baz/.//"` != "/foo/bar/baz" ]; then 56 echo "dirname(\"/foo/bar/baz/.//\") is \"/foo/bar/baz\"; expected \"`dirname "/foo/bar/baz/.//"`"\" 57fi 58 59if [ `basename "foo/bar/baz/"` != "baz" ]; then 60 echo "basename(\"foo/bar/baz/\") is \"baz\"; expected \"`basename "foo/bar/baz/"`"\" 61fi 62 63if [ `dirname "foo/bar/baz/"` != "foo/bar" ]; then 64 echo "dirname(\"foo/bar/baz/\") is \"foo/bar\"; expected \"`dirname "foo/bar/baz/"`"\" 65fi 66 67if [ `basename "/"` != "/" ]; then 68 echo "basename(\"/\") is \"/\"; expected \"`basename "/"`"\" 69fi 70 71if [ `dirname "/"` != "/" ]; then 72 echo "dirname(\"/\") is \"/\"; expected \"`dirname "/"`"\" 73fi 74 75if [ `basename "./"` != "." ]; then 76 echo "basename(\"./\") is \".\"; expected \"`basename "./"`"\" 77fi 78 79if [ `dirname "./"` != "." ]; then 80 echo "dirname(\"./\") is \".\"; expected \"`dirname "./"`"\" 81fi 82 83if [ `basename "//"` != "/" ]; then 84 echo "basename(\"//\") is \"/\"; expected \"`basename "//"`"\" 85fi 86 87if [ `dirname "//"` != "/" ]; then 88 echo "dirname(\"//\") is \"/\"; expected \"`dirname "//"`"\" 89fi 90 91if [ `basename "/."` != "." ]; then 92 echo "basename(\"/.\") is \".\"; expected \"`basename "/."`"\" 93fi 94 95if [ `dirname "/."` != "/" ]; then 96 echo "dirname(\"/.\") is \"/\"; expected \"`dirname "/."`"\" 97fi 98 99if [ `basename "/./"` != "." ]; then 100 echo "basename(\"/./\") is \".\"; expected \"`basename "/./"`"\" 101fi 102 103if [ `dirname "/./"` != "/" ]; then 104 echo "dirname(\"/./\") is \"/\"; expected \"`dirname "/./"`"\" 105fi 106 107if [ `basename "/./."` != "." ]; then 108 echo "basename(\"/./.\") is \".\"; expected \"`basename "/./."`"\" 109fi 110 111if [ `dirname "/./."` != "/." ]; then 112 echo "dirname(\"/./.\") is \"/.\"; expected \"`dirname "/./."`"\" 113fi 114 115if [ `basename "/.//"` != "." ]; then 116 echo "basename(\"/.//\") is \".\"; expected \"`basename "/.//"`"\" 117fi 118 119if [ `dirname "/.//"` != "/" ]; then 120 echo "dirname(\"/.//\") is \"/\"; expected \"`dirname "/.//"`"\" 121fi 122 123if [ `basename "."` != "." ]; then 124 echo "basename(\".\") is \".\"; expected \"`basename "."`"\" 125fi 126 127if [ `dirname "."` != "." ]; then 128 echo "dirname(\".\") is \".\"; expected \"`dirname "."`"\" 129fi 130 131if [ `basename "f"` != "f" ]; then 132 echo "basename(\"f\") is \"f\"; expected \"`basename "f"`"\" 133fi 134 135if [ `dirname "f"` != "." ]; then 136 echo "dirname(\"f\") is \".\"; expected \"`dirname "f"`"\" 137fi 138 139if [ `basename "f/"` != "f" ]; then 140 echo "basename(\"f/\") is \"f\"; expected \"`basename "f/"`"\" 141fi 142 143if [ `dirname "f/"` != "." ]; then 144 echo "dirname(\"f/\") is \".\"; expected \"`dirname "f/"`"\" 145fi 146 147if [ `basename "/////"` != "/" ]; then 148 echo "basename(\"/////\") is \"/\"; expected \"`basename "/////"`"\" 149fi 150 151if [ `dirname "/////"` != "/" ]; then 152 echo "dirname(\"/////\") is \"/\"; expected \"`dirname "/////"`"\" 153fi 154 155if [ `basename ""` != "." ]; then 156 echo "basename(\"\") is \".\"; expected \"`basename ""`"\" 157fi 158 159if [ `dirname ""` != "." ]; then 160 echo "dirname(\"\") is \".\"; expected \"`dirname ""`"\" 161fi 162 163 164