Commit 47b8a04c authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce is_dirpath and test for it

parent e7909be7
#!/bin/bash
# 2009-2010 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
filter_strip_spaces()
{
......@@ -38,3 +42,9 @@ initial_letter()
{
echo $1 | cut -c1
}
is_dirpath()
{
[ "$1" = "." ] && return $?
echo "$1" | grep -q "/"
}
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod strings
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$3' do not match with '$2'" || echo "OK for '$1' with '$2'"
}
checkit()
{
local RES
is_dirpath "$1"
RES=$?
check "$1" "$2" "$RES"
}
checkit . 0
checkit text 1
checkit text/ 0
checkit /text 0
checkit /text/test 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment