1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-01 19:02:22 +01:00

Merge remote-tracking branch 'origin/master' into fix-1063

This commit is contained in:
Martin Nordholts
2021-01-07 12:56:47 +01:00
8 changed files with 243 additions and 354 deletions

View File

@@ -7,10 +7,16 @@ use std::fs::File;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::str::from_utf8;
#[cfg(unix)]
use std::time::Duration;
const EXAMPLES_DIR: &str = "tests/examples";
#[cfg(unix)]
const SAFE_CHILD_PROCESS_CREATION_TIME: Duration = Duration::from_millis(100);
#[cfg(unix)]
const CHILD_WAIT_TIMEOUT: Duration = Duration::from_secs(15);
fn bat_raw_command() -> Command {
@@ -669,6 +675,17 @@ fn alias_pager_disable_long_overrides_short() {
.stdout(predicate::eq("pager-output\n").normalize());
}
#[test]
fn pager_failed_to_parse() {
bat()
.env("BAT_PAGER", "mismatched-quotes 'a")
.arg("--paging=always")
.arg("test.txt")
.assert()
.failure()
.stderr(predicate::str::contains("Could not parse pager command"));
}
#[test]
fn config_location_test() {
bat_with_config()