mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
Add test for pager warnings on Windows (#122)
This commit is contained in:
parent
95e6b0520f
commit
0b277c7515
1 changed files with 28 additions and 0 deletions
28
tests/lib.rs
28
tests/lib.rs
|
|
@ -415,3 +415,31 @@ fn test_autoupdate_cache() {
|
|||
// The cache is not updated with a subsequent call
|
||||
check_cache_updated(false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(target_os = "windows")]
|
||||
fn test_pager_warning() {
|
||||
let testenv = TestEnv::new();
|
||||
testenv
|
||||
.command()
|
||||
.args(&["--update"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(contains("Successfully updated cache."));
|
||||
|
||||
// Regular call should not show a "pager flag not available on windows" warning
|
||||
testenv
|
||||
.command()
|
||||
.args(&["tar"])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(contains("pager flag not available on Windows").not());
|
||||
|
||||
// But it should be shown if the pager flag is true
|
||||
testenv
|
||||
.command()
|
||||
.args(&["tar", "-p"])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(contains("pager flag not available on Windows"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue