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

# 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 a/a` != z"a"; then
	echo "FAIL: $TESTPROG a/a != a"
	exit
fi
if test z`$TESTPROG /a/asc .c` != z"asc"; then
	echo "FAIL: $TESTPROG /a/asc .c != asc"
	exit
fi
if test z`$TESTPROG /a/asd.c .c` != z"asd"; then
	echo "FAIL: $TESTPROG /a/asd.c .c != asd"
	exit
fi
if test z`$TESTPROG /a/asd.c asd.c` != z"asd.c"; then
	echo "FAIL: $TESTPROG /a/asd.c asd.c != asd.c"
	exit
fi
echo "PASS: basename"
else
 echo "SKIP: $TESTPROG doesn't exist"
fi
