mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
51 lines
1.1 KiB
Bash
51 lines
1.1 KiB
Bash
ynhtest_exec_warn_less() {
|
|
|
|
FOO='foo'
|
|
bar=""
|
|
BAR='$bar'
|
|
FOOBAR="foo bar"
|
|
|
|
# These looks like stupid edge case
|
|
# but in fact happens when dealing with passwords
|
|
# (which could also contain bash chars like [], {}, ...)
|
|
# or urls containing &, ...
|
|
FOOANDBAR="foo&bar"
|
|
FOO1QUOTEBAR="foo'bar"
|
|
FOO2QUOTEBAR="foo\"bar"
|
|
|
|
ynh_hide_warnings uptime
|
|
|
|
test ! -e $FOO
|
|
ynh_hide_warnings touch $FOO
|
|
test -e $FOO
|
|
rm $FOO
|
|
|
|
test ! -e $FOO1QUOTEBAR
|
|
ynh_hide_warnings touch $FOO1QUOTEBAR
|
|
test -e $FOO1QUOTEBAR
|
|
rm $FOO1QUOTEBAR
|
|
|
|
test ! -e $FOO2QUOTEBAR
|
|
ynh_hide_warnings touch $FOO2QUOTEBAR
|
|
test -e $FOO2QUOTEBAR
|
|
rm $FOO2QUOTEBAR
|
|
|
|
test ! -e $BAR
|
|
ynh_hide_warnings touch $BAR
|
|
test -e $BAR
|
|
rm $BAR
|
|
|
|
test ! -e "$FOOBAR"
|
|
ynh_hide_warnings touch "$FOOBAR"
|
|
test -e "$FOOBAR"
|
|
rm "$FOOBAR"
|
|
|
|
test ! -e "$FOOANDBAR"
|
|
ynh_hide_warnings touch $FOOANDBAR
|
|
test -e "$FOOANDBAR"
|
|
rm "$FOOANDBAR"
|
|
|
|
test ! -e $FOO
|
|
! ynh_hide_warnings "touch $FOO"
|
|
! test -e $FOO
|
|
}
|