readlink: test calling without args

This commit is contained in:
Daniel Hofstetter 2025-11-11 17:36:17 +01:00
parent 7bcf58d745
commit f264a40aa8

View file

@ -2,11 +2,11 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
//
// spell-checker:ignore regfile
use uutests::new_ucmd;
use uutests::path_concat;
use uutests::util::{TestScenario, get_root_path};
use uutests::{at_and_ucmd, util_name};
use uutests::{at_and_ucmd, new_ucmd, path_concat, util_name};
static GIBBERISH: &str = "supercalifragilisticexpialidocious";
@ -15,6 +15,14 @@ static NOT_A_DIRECTORY: &str = "Not a directory";
#[cfg(windows)]
static NOT_A_DIRECTORY: &str = "The directory name is invalid.";
#[test]
fn test_no_args() {
new_ucmd!()
.fails_with_code(1)
.no_stdout()
.stderr_contains("readlink: missing operand");
}
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);