Skip to content

Commit 22454f9

Browse files
committed
1 parent 2d21762 commit 22454f9

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

commands/echo-file

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,22 @@ function echo_file_test() (
1111
eval-tester --name='no args' -- \
1212
echo-file --
1313

14-
# CAT
14+
# PROCESS SUBSTITUTION
15+
# We do this before STDIN as otherwise it seems homebrew, only on CI, when installing bat on the `--bat` test, will cause the STDIN to be consumed during the install process: https://github.com/bevry/dorothy/actions/runs/21468532248/job/61835719599#step:4:15747
16+
# Perhaps `setup-util` when running a `--quiet` installation, needs to close STDIN for sources to prevent this.
17+
18+
# bat
19+
# `--ignore-tty`` as TTY will have install info
20+
# `--ignore-stderr` as STDERR will have failed install technique info
21+
setup-util-bat --uninstall --quiet
22+
eval-tester --ignore-tty --ignore-stderr --stdout=$'a·␊\n├──┤␊\n␀b\n' --trailing-newlines --ignore-tty --ignore-stderr -- \
23+
echo-file --no-color --raw --bat --hidden -- <(printf 'a \n\t\n\0b')
24+
25+
# cat
26+
eval-tester --stdout=$'a $\n^I$\n^@b' --trailing-newlines -- \
27+
echo-file --no-color --raw --bat=no --hidden -- <(printf 'a \n\t\n\0b')
28+
29+
# STDIN: cat
1530

1631
echo a | eval-tester --stdout=$'a\n' --trailing-newlines -- \
1732
echo-file --no-color --stdin --raw
@@ -34,12 +49,9 @@ function echo_file_test() (
3449
printf '\n\n\n' | eval-tester --stdout=$'< /dev/stdin />\n' --trailing-newlines -- \
3550
echo-file --no-color --stdin --raw --hidden --header --lines --trim
3651

37-
# BAT
38-
39-
setup-util-bat --uninstall --quiet
52+
# STDIN: bat
4053

41-
# TTY will have install info, and STDERR will have failed install technique info
42-
echo a | eval-tester --ignore-tty --ignore-stderr --stdout=$'a\n' --trailing-newlines -- \
54+
echo a | eval-tester --stdout=$'a\n' --trailing-newlines -- \
4355
echo-file --no-color --stdin --raw --bat
4456

4557
# for some reason on ubuntu, kali, and debian, this is resulting in no trailing newline
@@ -61,27 +73,23 @@ function echo_file_test() (
6173
printf '\n\n\n' | eval-tester --stdout='' --trailing-newlines -- \
6274
echo-file --no-color --stdin --raw --bat --hidden --trim
6375

64-
# PROCESS SUBSTITUTION
65-
66-
eval-tester --stdout=$'a $\n^I$\n^@b' --trailing-newlines -- \
67-
echo-file --no-color --raw --bat=no --hidden -- <(printf 'a \n\t\n\0b')
68-
69-
eval-tester --stdout=$'a·␊\n├──┤␊\n␀b\n' --trailing-newlines -- \
70-
echo-file --no-color --raw --bat --hidden -- <(printf 'a \n\t\n\0b')
71-
7276
# PATHS
7377

78+
# paths as arguments via cat
7479
eval-tester --stdout="$(cat "$DOROTHY/.gitignore")" -- \
7580
echo-file --no-color --raw --cat -- "$DOROTHY/.gitignore"
7681

82+
# paths as stdin via cat
7783
__print_lines "$DOROTHY/.gitignore" | eval-tester --stdout="$(cat "$DOROTHY/.gitignore")" -- \
7884
echo-file --no-color --raw --cat --stdin-paths
7985

8086
# EVERYTHING
8187

88+
# cat
8289
__print_lines 'this-is-stdin' | eval-tester --ignore-output -- \
8390
echo-file --stdin --cat -- <(__print_lines 'this-is-process-substitution') "$DOROTHY/.gitignore"
8491

92+
# bat
8593
__print_lines 'this-is-stdin' | eval-tester --ignore-output -- \
8694
echo-file --stdin --bat -- <(__print_lines 'this-is-process-substitution') "$DOROTHY/.gitignore"
8795

0 commit comments

Comments
 (0)