diff options
author | zwPapEr <zw.paper@gmail.com> | 2019-12-15 15:35:41 +0800 |
---|---|---|
committer | Abin Simon <abinsimon10@gmail.com> | 2020-01-11 14:17:44 +0530 |
commit | 74660f1d70267428b993eb2578e19b1a2d475325 (patch) | |
tree | 3d7a537f9e345546db7f0a5b9b0a2bf60e6fb407 | |
parent | 11d10caf0fd4c9e8209fb41fac88121ac903d753 (diff) |
test: add inode args integration test
-rw-r--r-- | tests/integration.rs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/integration.rs b/tests/integration.rs index c934f26..f662040 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -87,31 +87,45 @@ fn test_list_all_populated_directory() { } #[test] -#[cfg(unix)] fn test_list_inode_populated_directory() { let dir = tempdir(); dir.child("one").touch().unwrap(); dir.child("two").touch().unwrap(); + + #[cfg(unix)] + let matched = "\\d+ one\n\\d+ two\n$"; + #[cfg(windows)] + let matched = "- one\n\\- two\n$"; + cmd() - .arg("--blocks") - .arg("inode,name") + .arg("--inode") .arg(dir.path()) .assert() - .stdout(predicate::str::is_match("\\d+ one\n\\d+ two\n$").unwrap()); + .stdout(predicate::str::is_match(matched).unwrap()); + cmd() + .arg("-i") + .arg(dir.path()) + .assert() + .stdout(predicate::str::is_match(matched).unwrap()); } #[test] -#[cfg(windows)] -fn test_list_inode_populated_directory() { +fn test_list_block_inode_populated_directory() { let dir = tempdir(); dir.child("one").touch().unwrap(); dir.child("two").touch().unwrap(); + + #[cfg(unix)] + let matched = "\\d+ one\n\\d+ two\n$"; + #[cfg(windows)] + let matched = "- one\n\\- two\n$"; + cmd() .arg("--blocks") .arg("inode,name") .arg(dir.path()) .assert() - .stdout(predicate::str::is_match("- one\n\\- two\n$").unwrap()); + .stdout(predicate::str::is_match(matched).unwrap()); } fn cmd() -> Command { |