-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first infrastructure for unit-level tests
- Loading branch information
Sebastian Thiel
committed
Jun 2, 2019
1 parent
6d82a72
commit 1c53865
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(()) | ||
} | ||
} |