Commit 5215bd96 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add some tests

parent cf9009bc
__get_app_description()
{
local arch="$2"
#__run_script "$1" --description "$2" 2>/dev/null
if grep -q '^SUPPORTEDARCHES=.*\<'"$arch"'\>' "$psdir/$1.sh"; then
grep -oP "^DESCRIPTION=[\"']*\K[^\"']+" "$psdir/$1.sh"
fi
}
psdir=../play.d
app=i586-openssl098
__get_app_description $app x86_64
__get_app_package()
{
#__run_script "$1" --package-name "$2" "$3" 2>/dev/null
grep -oP "^PKGNAME=[\"']\K.*[^\"']+" "$psdir/$1.sh"
}
__get_app_package $app
#!/bin/sh
__convert_glob__to_regexp()
{
# translate glob to regexp
echo "$1" | sed -e "s|\*|.*|g" -e "s|?|.|g"
}
test()
{
res="$(__convert_glob__to_regexp "$1")"
if [ "$res" = "$2" ] ; then
echo "test for '$1': result '$res' is OK"
else
echo "test for '$1': result '$res' not equal to expected '$2'"
fi
}
test '[tcp][1-3]?[0-9][.f]?[0-9]?/branch/' '[tcp][1-3].[0-9][.f].[0-9]./branch/'
test '[tcp][1-3]*' '[tcp][1-3].*'
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