bsh project
This commit is contained in:
6
tests/case/basic.sh
Normal file
6
tests/case/basic.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
case test in
|
||||
te)
|
||||
echo wrong;;
|
||||
"test")
|
||||
echo ok ;;
|
||||
esac
|
||||
16
tests/case/case_in_function.sh
Normal file
16
tests/case/case_in_function.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
fun()
|
||||
{
|
||||
case fun in
|
||||
f)
|
||||
echo nope;;
|
||||
*)
|
||||
echo nice;;
|
||||
esac
|
||||
}
|
||||
|
||||
case call in
|
||||
call)
|
||||
fun;;
|
||||
c)
|
||||
echo what?;;
|
||||
esac
|
||||
13
tests/case/if_in_case_in_if.sh
Normal file
13
tests/case/if_in_case_in_if.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
a=true
|
||||
|
||||
if $a
|
||||
then
|
||||
case $a in
|
||||
false)
|
||||
echo false;;
|
||||
(true)
|
||||
echo $a;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo end
|
||||
4
tests/case/multiple_condition_case.sh
Normal file
4
tests/case/multiple_condition_case.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
case test in
|
||||
te|test|aaaaaaaaa)
|
||||
echo true;;
|
||||
esac
|
||||
Reference in New Issue
Block a user