From 5e9f8c0865f99fe4d614dc69c82eb1ca74ec363e Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 17 Dec 2017 00:45:59 +0100 Subject: rename arguments --- t/0.t | 63 ------------------------------------------------------- t/1.t | 76 ------------------------------------------------------------------- t/a.t | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ t/o.t | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 139 insertions(+), 139 deletions(-) delete mode 100755 t/0.t delete mode 100755 t/1.t create mode 100755 t/a.t create mode 100755 t/o.t (limited to 't') diff --git a/t/0.t b/t/0.t deleted file mode 100755 index c6e999c..0000000 --- a/t/0.t +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -export "PATH=.:$PATH" - -printf '1..11\n' -printf '# error handling\n' - -tap3 '-0 on a pipe, no newlines' <<'EOF' -printf foo | rnl -0 | wc -c ->>>/3/ -EOF - -tap3 '-0 on a pipe, one newline' <<'EOF' -printf 'foo\n' | rnl -0 | wc -c ->>>/3/ -EOF - -tap3 '-0 on a pipe, two newlines' <<'EOF' -printf 'foo\nbar\n\n' | rnl -0 | wc -c ->>>/7/ -EOF - -tap3 '-0 on a pipe, three newlines' <<'EOF' -printf 'foo\n\nbar\n\n\n' | rnl -0 | wc -c ->>>/8/ -EOF - -tap3 '-0 on a pipe, 9999 newlines' <<'EOF' -( printf 'foo'; yes '' | sed 10000q ) | rnl -0 | wc -c ->>>/3/ -EOF - - - -tap3 '-0 on a file, no newlines' <<'EOF' -printf foo > TMP; rnl -0 TMP; wc -c >>/3/ -EOF - -tap3 '-0 on a file, one newline' <<'EOF' -printf 'foo\n' > TMP; rnl -0 TMP; wc -c >>/3/ -EOF - -tap3 '-0 on a file, two newlines' <<'EOF' -printf 'foo\nbar\n\n' > TMP; rnl -0 TMP; wc -c >>/7/ -EOF - -tap3 '-0 on a file, three newlines' <<'EOF' -printf 'foo\n\nbar\n\n\n' > TMP; rnl -0 TMP; wc -c >>/8/ -EOF - -tap3 '-0 on a file, 9999 newlines' <<'EOF' -( printf 'foo'; yes '' | sed 10000q ) > TMP; rnl -0 TMP; wc -c >>/3/ -EOF - -tap3 '-0 on a biggish file, 9999 newlines' <<'EOF' -( yes 'foo' | sed 10000q; yes '' | sed 10000q ) > TMP; rnl -0 TMP; wc -c >>/39999/ -EOF diff --git a/t/1.t b/t/1.t deleted file mode 100755 index 34611af..0000000 --- a/t/1.t +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh - -export "PATH=.:$PATH" - -printf '1..11\n' -printf '# error handling\n' - -tap3 '-1 on a pipe, no newlines' <<'EOF' -printf foo | rnl -1 ->>>/foo/ -EOF - -tap3 '-1 on a pipe, one newline' <<'EOF' -printf 'foo\n' | rnl -1 | wc -c ->>>/3/ -EOF - -tap3 '-1 on a pipe, two newlines' <<'EOF' -printf 'foo\nbar\n\n' | rnl -1 ->>> -foo -bar -EOF - -tap3 '-1 on a pipe, three newlines' <<'EOF' -printf 'foo\n\nbar\n\n\n' | rnl -1 ->>> -foo - -bar - -EOF - -tap3 '-1 on a pipe, 9999 newlines' <<'EOF' -( printf 'foo'; yes '' | sed 10000q ) | rnl -1 | wc -l ->>>/9999/ -EOF - - - -tap3 '-1 on a file, no newlines' <<'EOF' -printf foo > TMP; rnl -1 TMP; cat TMP; rm TMP ->>>/foo/ -EOF - -tap3 '-1 on a file, one newline' <<'EOF' -printf 'foo\n' > TMP; rnl -1 TMP; wc -c TMP; rm TMP ->>>/3/ -EOF - -tap3 '-1 on a file, two newlines' <<'EOF' -printf 'foo\nbar\n\n' > TMP; rnl -1 TMP; cat TMP; rm TMP ->>> -foo -bar -EOF - -tap3 '-1 on a file, three newlines' <<'EOF' -printf 'foo\n\nbar\n\n\n' > TMP; rnl -1 TMP; cat TMP; rm TMP ->>> -foo - -bar - -EOF - -tap3 '-1 on a file, 9999 newlines' <<'EOF' -( printf 'foo'; yes '' | sed 10000q ) > TMP; rnl -1 TMP; wc -l TMP; rm TMP ->>>/9999/ -EOF - - -tap3 '-1 on a biggish file, 9999 newlines' <<'EOF' -( yes 'foo' | sed 10000q; yes '' | sed 10000q ) > TMP; rnl -1 TMP; wc -l < TMP; rm TMP ->>>/19999/ -EOF diff --git a/t/a.t b/t/a.t new file mode 100755 index 0000000..99405f7 --- /dev/null +++ b/t/a.t @@ -0,0 +1,63 @@ +#!/bin/sh + +export "PATH=.:$PATH" + +printf '1..11\n' +printf '# error handling\n' + +tap3 '-a on a pipe, no newlines' <<'EOF' +printf foo | rnl -a | wc -c +>>>/3/ +EOF + +tap3 '-a on a pipe, one newline' <<'EOF' +printf 'foo\n' | rnl -a | wc -c +>>>/3/ +EOF + +tap3 '-a on a pipe, two newlines' <<'EOF' +printf 'foo\nbar\n\n' | rnl -a | wc -c +>>>/7/ +EOF + +tap3 '-a on a pipe, three newlines' <<'EOF' +printf 'foo\n\nbar\n\n\n' | rnl -a | wc -c +>>>/8/ +EOF + +tap3 '-a on a pipe, 9999 newlines' <<'EOF' +( printf 'foo'; yes '' | sed 10000q ) | rnl -a | wc -c +>>>/3/ +EOF + + + +tap3 '-a on a file, no newlines' <<'EOF' +printf foo > TMP; rnl -a TMP; wc -c >>/3/ +EOF + +tap3 '-a on a file, one newline' <<'EOF' +printf 'foo\n' > TMP; rnl -a TMP; wc -c >>/3/ +EOF + +tap3 '-a on a file, two newlines' <<'EOF' +printf 'foo\nbar\n\n' > TMP; rnl -a TMP; wc -c >>/7/ +EOF + +tap3 '-a on a file, three newlines' <<'EOF' +printf 'foo\n\nbar\n\n\n' > TMP; rnl -a TMP; wc -c >>/8/ +EOF + +tap3 '-a on a file, 9999 newlines' <<'EOF' +( printf 'foo'; yes '' | sed 10000q ) > TMP; rnl -a TMP; wc -c >>/3/ +EOF + +tap3 '-a on a biggish file, 9999 newlines' <<'EOF' +( yes 'foo' | sed 10000q; yes '' | sed 10000q ) > TMP; rnl -a TMP; wc -c >>/39999/ +EOF 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 -- cgit 1.4.1