openrc/test/units/check-sh-yesno.sh

34 lines
857 B
Bash
Raw Normal View History

2008-03-24 12:47:05 +05:30
#!/bin/sh
# Copyright (c) 2008-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
2008-03-24 12:47:05 +05:30
top_srcdir=${SOURCE_ROOT:-..}
2009-04-27 02:43:26 +05:30
. $top_srcdir/test/setup_env.sh
2008-03-24 12:47:05 +05:30
ret=0
tret=0
for f in yes YES Yes true TRUE True 1 ; do
2009-04-27 02:43:26 +05:30
if ! yesno $f; then
: $(( tret += 1 ))
2009-04-27 02:43:26 +05:30
echo "!$f!"
2008-03-24 12:47:05 +05:30
fi
done
for f in no NO No false FALSE False 0 ; do
2009-04-27 02:43:26 +05:30
if yesno $f; then
: $(( tret += 1 ))
2009-04-27 02:43:26 +05:30
echo "!$f!"
2008-03-24 12:47:05 +05:30
fi
done
: $(( ret += $tret ))
2008-03-24 12:47:05 +05:30
eend $ret
2009-04-27 02:43:26 +05:30
exit $ret