⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.tests

📁 android-w.song.android.widget
💻 TESTS
字号:
if (( $UID == 0 )); then	echo "test-tests: the test suite should not be run as root" >&2fib(){	[ "$@" ]	echo $?}t(){	test "$@"	echo $?}echo 't -a noexist't -a noexistecho 't -a run-all't -a run-allecho 't -b run-all't -b run-allecho 't -b /dev/jb1a't -b /dev/jb1aecho 't -c run-all't -c run-allecho 't -c /dev/tty't -c /dev/ttyecho 't -d run-all't -d run-allecho 't -d /etc't -d /etcecho 't -d ""'t -d ""echo 'b -d ""'b -d ""echo 't -e noexist't -e noexistecho 't -e run-all't -e run-allecho 't -f noexist't -f noexistecho 't -f /dev/tty't -f /dev/ttyecho 't -f run-all't -f run-allecho 't -g run-all't -g run-alltouch /tmp/test.setgidchgrp ${GROUPS[0]} /tmp/test.setgidchmod ug+x /tmp/test.setgidchmod g+s /tmp/test.setgidecho 't -g /tmp/test.setgid't -g /tmp/test.setgidrm -f /tmp/test.setgidecho 't -k run-all't -k run-allecho 't -n ""'t -n ""echo 't -n "hello"'t -n "hello"echo 't -p run-all't -p run-allecho 't -r noexist't -r noexistif (( $UID != 0 )); then	touch /tmp/test.noread	chmod a-r /tmp/test.noread	echo 't -r /tmp/test.noread'	t -r /tmp/test.noread	rm -f /tmp/test.noreadelse	echo 't -r /tmp/test.noread'	echo 1fiecho 't -r run-all't -r run-allecho 't -s noexist't -s noexistecho 't -s /dev/null't -s /dev/nullecho 't -s run-all't -s run-allecho 't -t 20't -t 20echo 't -t 0't -t 0 < /dev/ttyecho 't -u noexist't -u noexistecho 't -u run-all't -u run-alltouch /tmp/test.setuidchmod u+x /tmp/test.setuid	# some systems require this to turn on setuid bitchmod u+s /tmp/test.setuidecho 't -u /tmp/test.setuid't -u /tmp/test.setuidrm -f /tmp/test.setuidecho 't -w noexist't -w noexistif (( $UID != 0 )); then	touch /tmp/test.nowrite	chmod a-w /tmp/test.nowrite	echo 't -w /tmp/test.nowrite'	t -w /tmp/test.nowrite	rm -f /tmp/test.nowriteelse	echo 't -w /tmp/test.nowrite'	echo 1fiecho 't -w /dev/null't -w /dev/nullecho 't -x noexist't -x noexisttouch /tmp/test.execchmod u+x /tmp/test.exececho 't -x /tmp/test.exec't -x /tmp/test.execrm -f /tmp/test.exectouch /tmp/test.noexecchmod u-x /tmp/test.noexececho 't -x /tmp/test.noexec't -x /tmp/test.noexecrm -f /tmp/test.noexececho 't -z ""'t -z ""echo 't -z "foo"'t -z "foo"echo 't "foo"'t "foo"echo 't ""'t ""touch /tmp/test.ownerecho 't -O /tmp/test.owner't -O /tmp/test.ownerrm -f /tmp/test.ownertouch /tmp/test.socketecho 't -S /tmp/test.socket't -S /tmp/test.socket	# falserm -f /tmp/test.sockettouch /tmp/test.newerecho 't -N /tmp/test.newer't -N /tmp/test.newerrm -f /tmp/test.newerecho 't "hello" = "hello"'t "hello" = "hello"echo 't "hello" = "goodbye"'t "hello" = "goodbye"echo 't "hello" == "hello"'t "hello" == "hello"echo 't "hello" == "goodbye"'t "hello" == "goodbye"echo 't "hello" != "hello"'t "hello" != "hello"echo 't "hello" != "goodbye"'t "hello" != "goodbye"echo 't "hello" < "goodbye"'t "hello" \< "goodbye"echo 't "hello" > "goodbye"'t "hello" \> "goodbye"echo 't ! "hello" > "goodbye"'t "! hello" \> "goodbye"echo 't 200 -eq 200't 200 -eq 200echo 't 34 -eq 222't 34 -eq 222echo 't -32 -eq 32't -32 -eq 32echo 't 200 -ne 200't 200 -ne 200echo 't 34 -ne 222't 34 -ne 222echo 't 200 -gt 200't 200 -gt 200echo 't 340 -gt 222't 340 -gt 222echo 't 200 -ge 200't 200 -ge 200echo 't 34 -ge 222't 34 -ge 222echo 't 200 -lt 200't 200 -lt 200echo 't 34 -lt 222't 34 -lt 222echo 't 200 -le 200't 200 -le 200echo 't 340 -le 222't 340 -le 222echo 't 700 -le 1000 -a -n "1" -a "20" = "20"'t 700 -le 1000 -a -n "1" -a "20" = "20"echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)'t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)touch /tmp/abcsleep 2touch /tmp/defecho 't /tmp/abc -nt /tmp/def't /tmp/abc -nt /tmp/defecho 't /tmp/abc -ot /tmp/def't /tmp/abc -ot /tmp/defecho 't /tmp/def -nt /tmp/abc't /tmp/def -nt /tmp/abcecho 't /tmp/def -ot /tmp/abc't /tmp/def -ot /tmp/abcecho 't /tmp/abc -ef /tmp/def't /tmp/abc -ef /tmp/defln /tmp/abc /tmp/ghiecho 't /tmp/abc -ef /tmp/ghi't /tmp/abc -ef /tmp/ghirm /tmp/abc /tmp/def /tmp/ghiecho 't -r /dev/fd/0't -r /dev/fd/0echo 't -w /dev/fd/1't -w /dev/fd/1echo 't -w /dev/fd/2't -w /dev/fd/2echo 't -r /dev/stdin't -r /dev/stdinecho 't -w /dev/stdout't -w /dev/stdoutecho 't -w /dev/stderr't -w /dev/stderrecho 't'techo 'b'becho 't 12 -eq 34't 12 -eq 34echo 't ! 12 -eq 34't ! 12 -eq 34echo 't -n abcd -o aaa't -n abcd -o aaaecho 't -n abcd -o -z aaa't -n abcd -o -z aaaecho 't -n abcd -a aaa't -n abcd -a aaaecho 't -n abcd -a -z aaa't -n abcd -a -z aaa# test set or unset shell optionsset +o allexportecho 't -o allexport't -o allexportecho 't ! -o allexport't ! -o allexport#test set or unset shell variablesunset unsetecho 't -v unset't -v unsetset=echo 't -v set't -v setset=setecho 't -v set't -v setecho 't xx -a yy't xx -a yyecho 't xx -o ""'t xx -o ""echo 't xx -a ""'t xx -a ""echo 't -X -a -X't -X -a -Xecho 't -X -o -X't -X -o -Xecho 't -X -o ""'t -X -o ""echo 't -X -a ""'t -X -a ""echo 't "" -a -X't "" -a -Xecho 't "" -o -X't "" -o -Xecho 't "" -a ""'t "" -a ""echo 't "" -o ""'t "" -o ""echo 't true -o -X't true -o -Xecho 't true -a -X't true -a -Xecho 't ( -E )'t \( -E \)echo 't ( "" )'t \( "" \)z=42echo 't ! -z "$z"'t ! -z "$z"echo 't ! -n "$z"'t ! -n "$z"zero=echo 't "$zero"'t "$zero"echo 't ! "$zero"'t ! "$zero"echo 'b "$zero"'b "$zero"echo 'b ! "$zero"'b ! "$zero"touch /tmp/test.groupchgrp ${GROUPS[0]} /tmp/test.groupecho 't -G /tmp/test.group't -G /tmp/test.grouprm /tmp/test.groupcase "${THIS_SH}" in/*)	SHNAME=${THIS_SH} ;;*)	SHNAME=${PWD}/${THIS_SH} ;;esacif ln -s ${SHNAME} /tmp/test.symlink 2>/dev/null; then	chgrp ${GROUPS[0]} /tmp/test.symlink 2>/dev/null	echo 't -h /tmp/test.symlink'	t -h /tmp/test.symlink	# some systems don't let you remove this	rm -f /tmp/test.symlink 2>/dev/nullelse	echo 't -h /tmp/test.symlink'	echo 0fi# arithmetic constant errorsecho "t 4+3 -eq 7"t 4+3 -eq 7echo "b 4-5 -eq 7"b 4+3 -eq 7echo "t 9 -eq 4+5"t 9 -eq 4+5echo "b 9 -eq 4+5"b 9 -eq 4+5A=7echo "t A -eq 7"t A -eq 7echo "b A -eq 7"b A -eq 7B=9echo "t 9 -eq B"t 9 -eq Becho "b 9 -eq B"b 9 -eq B# badly formed expressionsecho 't ( 1 = 2't \( 1 = 2echo 'b ( 1 = 2'b \( 1 = 2# more errorst a bt a b ct -A v# too many arguments -- argument expected is also reasonablet 4 -eq 4 -a 2 -ne 5 -a 4 -ne# too many argumentst 4 -eq 4 -a 3 4[echo $?t \( \)# non-numeric arguments to `test -t' should return failure -- fix in 2.05echo 't -t a't -t aecho 't -t addsds't -t addsdsecho 't -t 42't -t 42echo 't -t /dev/tty't -t /dev/ttyecho 't -t /dev/tty4't -t /dev/tty4echo 't -t /dev/tty4444444...'t -t /dev/tty4444444...# fixed in bash-4.0-betat -t ' '

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -