summaryrefslogtreecommitdiffstats
path: root/src/interactive/app_test
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-15 16:21:08 +0800
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-15 16:25:29 +0800
commit08dfbb633fe25cc922b898aaf367f26a08730d91 (patch)
treec9653c772f145b46aef9df68a166456f5e801e29 /src/interactive/app_test
parent48813ae0a1c9316b4a7ad1669de2c44389026769 (diff)
This might be the first working version of deletion
Diffstat (limited to 'src/interactive/app_test')
-rw-r--r--src/interactive/app_test/journeys_with_writes.rs12
-rw-r--r--src/interactive/app_test/utils.rs4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/interactive/app_test/journeys_with_writes.rs b/src/interactive/app_test/journeys_with_writes.rs
index e8cd6b5..cbd51cd 100644
--- a/src/interactive/app_test/journeys_with_writes.rs
+++ b/src/interactive/app_test/journeys_with_writes.rs
@@ -29,14 +29,9 @@ fn basic_user_journey_with_deletion() -> Result<(), Error> {
// When selecting the marker window and pressing the combination to delete entries
app.process_events(
&mut terminal,
- vec![Ok(Key::Char('\t')), Ok(Key::Ctrl('R'))].into_iter(),
+ vec![Ok(Key::Char('\t')), Ok(Key::Ctrl('r'))].into_iter(),
)?;
assert_eq!(
- fixture.as_ref().is_dir(),
- false,
- "the directory should have been deleted"
- );
- assert_eq!(
app.window.mark_pane.is_none(),
true,
"the marker pane is gone as all entries have been removed"
@@ -46,5 +41,10 @@ fn basic_user_journey_with_deletion() -> Result<(), Error> {
app.state.root, app.traversal.root_index,
"the only root left is the top-level"
);
+ assert_eq!(
+ fixture.as_ref().is_dir(),
+ false,
+ "the directory should have been deleted",
+ );
Ok(())
}
diff --git a/src/interactive/app_test/utils.rs b/src/interactive/app_test/utils.rs
index 144a4cc..7488143 100644
--- a/src/interactive/app_test/utils.rs
+++ b/src/interactive/app_test/utils.rs
@@ -65,7 +65,7 @@ pub struct WritableFixture {
impl Drop for WritableFixture {
fn drop(&mut self) {
- delete_recursive(&self.root).unwrap();
+ delete_recursive(&self.root).ok();
}
}
@@ -74,7 +74,7 @@ fn delete_recursive(path: impl AsRef<Path>) -> Result<(), Error> {
let mut dirs: Vec<_> = Vec::new();
for entry in WalkDir::new(&path).num_threads(1).into_iter() {
- let entry: DirEntry = entry.unwrap();
+ let entry: DirEntry = entry?;
let p = entry.path();
match p.is_dir() {
true => dirs.push(p),