Ai
1 Star 0 Fork 2

BuildOpenSource/busybox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.tests 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "command" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing to stdout
# Need to call 'busybox test', otherwise shell builtin is used
testing "test: should be false (1)" \
"busybox test; echo \$?" \
"1\n" \
"" ""
testing "test '': should be false (1)" \
"busybox test ''; echo \$?" \
"1\n" \
"" ""
testing "test !: should be true (0)" \
"busybox test !; echo \$?" \
"0\n" \
"" ""
testing "test a: should be true (0)" \
"busybox test a; echo \$?" \
"0\n" \
"" ""
testing "test --help: should be true (0)" \
"busybox test --help; echo \$?" \
"0\n" \
"" ""
testing "test -f: should be true (0)" \
"busybox test -f; echo \$?" \
"0\n" \
"" ""
testing "test ! -f: should be false (1)" \
"busybox test ! -f; echo \$?" \
"1\n" \
"" ""
testing "test a = a: should be true (0)" \
"busybox test a = a; echo \$?" \
"0\n" \
"" ""
testing "test -lt = -gt: should be false (1)" \
"busybox test -lt = -gt; echo \$?" \
"1\n" \
"" ""
testing "test a -a !: should be true (0)" \
"busybox test a -a !; echo \$?" \
"0\n" \
"" ""
testing "test -f = a -o b: should be true (0)" \
"busybox test -f = a -o b; echo \$?" \
"0\n" \
"" ""
testing "test ! a = b -a ! c = c: should be false (1)" \
"busybox test ! a = b -a ! c = c; echo \$?" \
"1\n" \
"" ""
testing "test ! a = b -a ! c = d: should be true (0)" \
"busybox test ! a = b -a ! c = d; echo \$?" \
"0\n" \
"" ""
testing "test '!' = '!': should be true (0)" \
"busybox test '!' = '!'; echo \$?" \
"0\n" \
"" ""
testing "test '(' = '(': should be true (0)" \
"busybox test '(' = '('; echo \$?" \
"0\n" \
"" ""
testing "test '!' '!' = '!': should be false (1)" \
"busybox test '!' '!' = '!'; echo \$?" \
"1\n" \
"" ""
testing "test '!' '(' = '(': should be false (1)" \
"busybox test '!' '(' = '('; echo \$?" \
"1\n" \
"" ""
exit $FAILCOUNT
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/build-open-source/busybox.git
git@gitee.com:build-open-source/busybox.git
build-open-source
busybox
busybox
master

搜索帮助