Ai
1 Star 0 Fork 2

BuildOpenSource/busybox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rev.tests 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
Ron Yorston 提交于 2021-08-21 16:36 +08:00 . rev: correct output for long input lines
#!/bin/sh
# Copyright 2021 by Ron Yorston
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "commands" "expected result" "file input" "stdin"
testing "rev works" \
"rev input" \
"\
1 enil
3 enil
" \
"line 1\n\nline 3\n" \
""
testing "rev file with missing newline" \
"rev input" \
"\
1 enil
3 enil" \
"line 1\n\nline 3" \
""
testing "rev file with NUL character" \
"rev input" \
"\
nil
3 enil
" \
"lin\000e 1\n\nline 3\n" \
""
testing "rev file with long line" \
"rev input" \
"\
+--------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------
cba
" \
"---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+--------------+\nabc\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

搜索帮助