First integration test

This test needs neatening but it is the first example of a working
integration test
This commit is contained in:
bootandy
2018-04-05 14:08:53 +01:00
parent f39b09e79c
commit 5c6165da8a
6 changed files with 51 additions and 11 deletions
+28
View File
@@ -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();
}