下载地址:
https://code.google.com/p/shunit2/
帮助:
https://code.google.com/p/shunit2/wiki/GeneralFaq
使用方式:http://wenku.baidu.com/view/4096d90eba1aa8114431d943.html
#!/bin/sh
hello()
{
echo "hello,word!";
}
test_hello()
{
assertEquals "$(hello)" 'hello,word!'
}
. /usr/share/shunit2/shunit2
输出:
assertEquals三个参数时:
assertEquals "${msg}" "${expected}" "${actual}"