tests/basename: add tests for --version, --help
use crate::common::util::*;
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]
fn test_directory() {
new_ucmd!()
