From 1c538654fba3caf7f7d601d6bf8a4af24faf19c8 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 2 Jun 2019 13:20:05 +0530 Subject: first infrastructure for unit-level tests --- tests/interactive.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/interactive.rs (limited to 'tests') 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(()) + } +} -- cgit v1.2.3