mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests/basename: add tests for --version, --help
This commit is contained in:
parent
7e07438b38
commit
4275661020
1 changed files with 23 additions and 0 deletions
|
@ -1,6 +1,29 @@
|
||||||
use crate::common::util::*;
|
use crate::common::util::*;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_help() {
|
||||||
|
for help_flg in vec!["-h", "--help"] {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg(&help_flg)
|
||||||
|
.succeeds()
|
||||||
|
.no_stderr()
|
||||||
|
.stdout_contains("USAGE:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_version() {
|
||||||
|
for version_flg in vec!["-V", "--version"] {
|
||||||
|
assert!(new_ucmd!()
|
||||||
|
.arg(&version_flg)
|
||||||
|
.succeeds()
|
||||||
|
.no_stderr()
|
||||||
|
.stdout_str()
|
||||||
|
.starts_with("basename"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_directory() {
|
fn test_directory() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue