mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
First integration test
This test needs neatening but it is the first example of a working integration test
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
extern crate ansi_term;
|
||||
use super::*;
|
||||
use display::format_string;
|
||||
|
||||
// TESTS TODO:
|
||||
// handle recursive dirs
|
||||
// handle soft links
|
||||
// handle hard links
|
||||
|
||||
#[test]
|
||||
pub fn test_main() {
|
||||
let r = format!(
|
||||
"{}
|
||||
{}
|
||||
{}
|
||||
{}",
|
||||
format_string("src/test_dir", true, " 4.0K", ""),
|
||||
format_string("src/test_dir/many", true, " 4.0K", "└─┬",),
|
||||
format_string("src/test_dir/many/hello_file", true, " 4.0K", " ├──",),
|
||||
format_string("src/test_dir/many/a_file", false, " 0B", " └──",),
|
||||
);
|
||||
|
||||
assert_cli::Assert::main_binary()
|
||||
.with_args(&["src/test_dir"])
|
||||
.stdout()
|
||||
.is(r)
|
||||
.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user