diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-02 13:20:05 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-02 13:20:05 +0530 |
commit | 1c538654fba3caf7f7d601d6bf8a4af24faf19c8 (patch) | |
tree | d384f68b43bb482a735ffa49d5ccd31d7ce29367 /tests | |
parent | 6d82a724b0452e417e20cbe8a02e3bed647e9674 (diff) |
first infrastructure for unit-level tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/interactive.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/interactive.rs b/tests/interactive.rs new file mode 100644 index 0000000..52ae8bc --- /dev/null +++ b/tests/interactive.rs @@ -0,0 +1,25 @@ +mod app { + use dua::interactive::App; + use dua::{ByteFormat, Color, WalkOptions}; + use failure::Error; + use std::path::Path; + use tui::backend::TestBackend; + use tui::Terminal; + + #[test] + fn journey_with_single_path() -> Result<(), Error> { + let mut terminal = Terminal::new(TestBackend::new(40, 20))?; + let input = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/sample-01"); + + let app = App::initialize( + &mut terminal, + WalkOptions { + threads: 1, + byte_format: ByteFormat::Metric, + color: Color::None, + }, + vec![input], + )?; + Ok(()) + } +} |