diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-12-17 00:45:59 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-12-17 00:45:59 +0100 |
commit | 5e9f8c0865f99fe4d614dc69c82eb1ca74ec363e (patch) | |
tree | 4e793f868195ed1aecddb5169b2fdd131fc3b478 /t/o.t | |
parent | 3d937d13bf77a2cda41a0a9ba8fc6d1e7885cf70 (diff) | |
download | rnl-5e9f8c0865f99fe4d614dc69c82eb1ca74ec363e.tar.gz rnl-5e9f8c0865f99fe4d614dc69c82eb1ca74ec363e.tar.xz rnl-5e9f8c0865f99fe4d614dc69c82eb1ca74ec363e.zip |
rename arguments
Diffstat (limited to 't/o.t')
-rwxr-xr-x | t/o.t | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/t/o.t b/t/o.t new file mode 100755 index 0000000..78ec064 --- /dev/null +++ b/t/o.t @@ -0,0 +1,76 @@ +#!/bin/sh + +export "PATH=.:$PATH" + +printf '1..11\n' +printf '# error handling\n' + +tap3 '-o on a pipe, no newlines' <<'EOF' +printf foo | rnl -o +>>>/foo/ +EOF + +tap3 '-o on a pipe, one newline' <<'EOF' +printf 'foo\n' | rnl -o | wc -c +>>>/3/ +EOF + +tap3 '-o on a pipe, two newlines' <<'EOF' +printf 'foo\nbar\n\n' | rnl -o +>>> +foo +bar +EOF + +tap3 '-o on a pipe, three newlines' <<'EOF' +printf 'foo\n\nbar\n\n\n' | rnl -o +>>> +foo + +bar + +EOF + +tap3 '-o on a pipe, 9999 newlines' <<'EOF' +( printf 'foo'; yes '' | sed 10000q ) | rnl -o | wc -l +>>>/9999/ +EOF + + + +tap3 '-o on a file, no newlines' <<'EOF' +printf foo > TMP; rnl -o TMP; cat TMP; rm TMP +>>>/foo/ +EOF + +tap3 '-o on a file, one newline' <<'EOF' +printf 'foo\n' > TMP; rnl -o TMP; wc -c TMP; rm TMP +>>>/3/ +EOF + +tap3 '-o on a file, two newlines' <<'EOF' +printf 'foo\nbar\n\n' > TMP; rnl -o TMP; cat TMP; rm TMP +>>> +foo +bar +EOF + +tap3 '-o on a file, three newlines' <<'EOF' +printf 'foo\n\nbar\n\n\n' > TMP; rnl -o TMP; cat TMP; rm TMP +>>> +foo + +bar + +EOF + +tap3 '-o on a file, 9999 newlines' <<'EOF' +( printf 'foo'; yes '' | sed 10000q ) > TMP; rnl -o TMP; wc -l TMP; rm TMP +>>>/9999/ +EOF + + +tap3 '-o on a biggish file, 9999 newlines' <<'EOF' +( yes 'foo' | sed 10000q; yes '' | sed 10000q ) > TMP; rnl -o TMP; wc -l < TMP; rm TMP +>>>/19999/ +EOF |