mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 14:49:04 +00:00
chore: formatting
This commit is contained in:
parent
de5fe1aa3f
commit
0682071dbd
2 changed files with 16 additions and 9 deletions
|
@ -49,7 +49,12 @@ macro_rules! logger_thread {
|
||||||
if buf.is_empty() {
|
if buf.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
match $sender.clone().lock().expect("Could not lock sender").send(buf) {
|
match $sender
|
||||||
|
.clone()
|
||||||
|
.lock()
|
||||||
|
.expect("Could not lock sender")
|
||||||
|
.send(buf)
|
||||||
|
{
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(_) => return,
|
Err(_) => return,
|
||||||
};
|
};
|
||||||
|
@ -57,11 +62,15 @@ macro_rules! logger_thread {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Runner {
|
impl Runner {
|
||||||
pub fn new(environment: Option<HashMap<String, String>>, command: String, args: Vec<String>) -> Self {
|
pub fn new(
|
||||||
|
environment: Option<HashMap<String, String>>,
|
||||||
|
command: String,
|
||||||
|
args: Vec<String>,
|
||||||
|
) -> Self {
|
||||||
let (sender, receiver) = sync_channel(64000);
|
let (sender, receiver) = sync_channel(64000);
|
||||||
Self {
|
Self {
|
||||||
environment: match environment {
|
environment: match environment {
|
||||||
|
@ -179,10 +188,7 @@ mod tests {
|
||||||
runner.terminate();
|
runner.terminate();
|
||||||
assert_eq!(runner.status(), RunnerStatus::Stopped);
|
assert_eq!(runner.status(), RunnerStatus::Stopped);
|
||||||
let out = runner.get_output();
|
let out = runner.get_output();
|
||||||
assert_eq!(
|
assert_eq!(out, "REX2TEST: Lorem ipsum dolor\n");
|
||||||
out,
|
|
||||||
"REX2TEST: Lorem ipsum dolor\n"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -197,7 +203,9 @@ mod tests {
|
||||||
sleep(time::Duration::from_millis(10));
|
sleep(time::Duration::from_millis(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
runner.save_output("./target/testout/testlog".into());
|
runner
|
||||||
|
.save_output("./target/testout/testlog".into())
|
||||||
|
.expect("Failed to save output file");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
pub mod main_win;
|
pub mod main_win;
|
||||||
pub mod widgets;
|
pub mod widgets;
|
||||||
pub mod styles;
|
pub mod styles;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue