mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests ~ reorganize tests
This commit is contained in:
parent
1c88bc8c45
commit
de0375f909
75 changed files with 0 additions and 0 deletions
34
tests/by-util/test_realpath.rs
Normal file
34
tests/by-util/test_realpath.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
use crate::common::util::*;
|
||||
|
||||
#[test]
|
||||
fn test_current_directory() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let actual = ucmd.arg(".").run().stdout;
|
||||
let expect = at.root_dir_resolved() + "\n";
|
||||
println!("actual: {:?}", actual);
|
||||
println!("expect: {:?}", expect);
|
||||
assert_eq!(actual, expect);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_long_redirection_to_current_dir() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
// Create a 256-character path to current directory
|
||||
let dir = path_concat!(".", ..128);
|
||||
let actual = ucmd.arg(dir).run().stdout;
|
||||
let expect = at.root_dir_resolved() + "\n";
|
||||
println!("actual: {:?}", actual);
|
||||
println!("expect: {:?}", expect);
|
||||
assert_eq!(actual, expect);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_long_redirection_to_root() {
|
||||
// Create a 255-character path to root
|
||||
let dir = path_concat!("..", ..85);
|
||||
let actual = new_ucmd!().arg(dir).run().stdout;
|
||||
let expect = get_root_path().to_owned() + "\n";
|
||||
println!("actual: {:?}", actual);
|
||||
println!("expect: {:?}", expect);
|
||||
assert_eq!(actual, expect);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue