#!/bin/sh
# $Id: dirname.sh,v 1.2 2001/10/11 19:39:03 cubbi Exp $
TESTPROG=`pwd`/../bin/dirname

# Test 0: check if it exists
if test -f $TESTPROG; then

# Test 1: check if the output of our pwd is exactly the same as of system pwd
if test z`$TESTPROG /` != z"/"; then
	echo "FAIL: $TESTPROG / != /"
	exit
fi
if test z`$TESTPROG ////` != z"/"; then
	echo "FAIL: $TESTPROG //// != /"
	exit
fi
if test z`$TESTPROG ""` != z"."; then
	echo 'FAIL: $TESTPROG "" != .'
	exit
fi
if test z`$TESTPROG asd////` != z"."; then
	echo 'FAIL: $TESTPROG asd//// != .'
	exit
fi
if test z`$TESTPROG a/a` != z"a"; then
	echo "FAIL: $TESTPROG a/a != a"
	exit
fi
if test z`$TESTPROG /a/a` != z"/a"; then
	echo "FAIL: $TESTPROG /a/a != /a"
	exit
fi


echo "PASS: dirname"

else
 echo "SKIP: $TESTPROG doesn't exist"
fi
