-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue 2561, send all [bat error]s to stderr in default_error_handler #2827
base: master
Are you sure you want to change the base?
Changes from all commits
54cec4a
6ea3ac7
6b90c21
6a0f6be
76a655d
cb2f8f8
7ae3185
635175e
1f3e3e0
e5858e2
ed6aad7
10fd0b7
b1819cb
ac4f4b4
2a29029
b05cde7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -748,6 +748,16 @@ fn env_var_bat_pager_value_bat() { | |
.stderr(predicate::str::contains("bat as a pager is disallowed")); | ||
} | ||
|
||
#[test] | ||
fn bat_error_to_stderr() { | ||
bat() | ||
.env("BAT_PAGER", "bat") | ||
.arg("/tmp") | ||
.assert() | ||
.failure() | ||
.stderr(predicate::str::contains("[bat error]")); | ||
} | ||
|
||
#[test] | ||
fn pager_value_bat() { | ||
bat() | ||
|
@@ -1194,6 +1204,9 @@ fn can_print_file_starting_with_cache() { | |
.stderr(""); | ||
} | ||
|
||
#[test] | ||
fn send_all_bat_error_to_stderr() {} | ||
Comment on lines
+1207
to
+1208
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? |
||
|
||
#[test] | ||
fn does_not_print_unwanted_file_named_cache() { | ||
bat_with_config().arg("cach").assert().failure(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
## test for issue 2561 | ||
|
||
OUTPUT=$(mktemp) | ||
BAT=bat | ||
code=$($BAT /tmp 2> $OUTPUT; cat $OUTPUT | grep error; echo $?) | ||
|
||
if [[ $code == 1 ]]; then | ||
echo "stderr test fsil" | ||
exit 1 | ||
fi | ||
|
||
exit 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please turn this into a Rust-based integration test. See There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script is still here. Can it be removed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the empty lines