Ai
1 Star 0 Fork 2

BuildOpenSource/busybox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sum.tests 849 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
# unit test for sum.
# Copyright 2007 by Bernhard Reutner-Fischer
# Licensed under GPLv2 or later, see file LICENSE in this source tree.
# AUDIT: Unit tests for sum
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing to stdout
testing "sum -r file doesn't print file's name" \
"sum -r '$0' | grep -c '$0' && echo wrongly_printed_filename || echo yes" \
"0\nyes\n" "" ""
testing "sum -r file file does print both names" \
"sum -r '$0' '$0' | grep -c '$0' && echo yes || echo wrongly_omitted_filename" \
"2\nyes\n" "" ""
testing "sum -s file does print file's name" \
"sum -s '$0' | grep -c '$0' && echo yes || echo wrongly_omitted_filename" \
"1\nyes\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

搜索帮助