1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

tests/basename: add tests for --version, --help

This commit is contained in:
bashi8128 2021-05-02 13:47:36 +09:00
parent 7e07438b38
commit 4275661020

View file

@ -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!()