mirror of
https://github.com/uutils/coreutils
synced 2024-12-19 01:23:53 +00:00
23 lines
589 B
Rust
23 lines
589 B
Rust
|
use common::util::*;
|
||
|
|
||
|
static UTIL_NAME: &'static str = "pathchk";
|
||
|
|
||
|
#[test]
|
||
|
fn test_default_mode() {
|
||
|
// test the default mode
|
||
|
{
|
||
|
// accept some reasonable default
|
||
|
let (_, mut ucmd) = testing(UTIL_NAME);
|
||
|
let result = ucmd.args(&["abc/def"]).run();
|
||
|
assert_eq!(result.stdout, "");
|
||
|
assert!(result.success);
|
||
|
}
|
||
|
{
|
||
|
// fail on long inputs
|
||
|
let (_, mut ucmd) = testing(UTIL_NAME);
|
||
|
let result = ucmd.args(&[repeat_str("test", 20000)]).run();
|
||
|
assert_eq!(result.stdout, "");
|
||
|
assert!(!result.success);
|
||
|
}
|
||
|
}
|