mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-07-30 20:58:45 +00:00
chore: remove some comments; remove unnecessary test with sleep; detail could not get stat warning
This commit is contained in:
parent
cf2fa339ad
commit
a14b44d176
4 changed files with 3 additions and 22 deletions
|
@ -222,24 +222,7 @@ mod tests {
|
||||||
use crate::profile::Profile;
|
use crate::profile::Profile;
|
||||||
use crate::runner::Runner;
|
use crate::runner::Runner;
|
||||||
use core::time;
|
use core::time;
|
||||||
use std::{collections::HashMap, path::Path, thread::sleep};
|
use std::{path::Path, thread::sleep};
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn can_run_command_and_read_env() {
|
|
||||||
let mut env = HashMap::new();
|
|
||||||
env.insert("ENVISIONTEST".to_string(), "Lorem ipsum dolor".to_string());
|
|
||||||
let mut runner = CmdRunner::new(
|
|
||||||
Some(env),
|
|
||||||
"bash".into(),
|
|
||||||
vec!["-c".into(), "echo \"ENVISIONTEST: $ENVISIONTEST\"".into()],
|
|
||||||
);
|
|
||||||
runner.start();
|
|
||||||
sleep(time::Duration::from_millis(1000)); // TODO: ugly, fix
|
|
||||||
runner.terminate();
|
|
||||||
assert_eq!(runner.status(), RunnerStatus::Stopped(Some(0)));
|
|
||||||
let out = runner.consume_output();
|
|
||||||
assert_eq!(out, "ENVISIONTEST: Lorem ipsum dolor\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_save_log() {
|
fn can_save_log() {
|
||||||
|
|
|
@ -33,7 +33,7 @@ pub struct Config {
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Config {
|
Config {
|
||||||
// TODO: handle first start with no profile selected
|
// TODO: using an empty string here is ugly
|
||||||
selected_profile_uuid: "".to_string(),
|
selected_profile_uuid: "".to_string(),
|
||||||
debug_view_enabled: false,
|
debug_view_enabled: false,
|
||||||
user_profiles: vec![],
|
user_profiles: vec![],
|
||||||
|
|
|
@ -86,7 +86,6 @@ impl AsyncFactoryComponent for DeviceRowModel {
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
root = adw::ActionRow {
|
root = adw::ActionRow {
|
||||||
// TODO: replace with flat button that spawns popover
|
|
||||||
add_prefix: icon = >k::Image {
|
add_prefix: icon = >k::Image {
|
||||||
set_icon_name: Some(self.state.icon()),
|
set_icon_name: Some(self.state.icon()),
|
||||||
},
|
},
|
||||||
|
|
|
@ -248,9 +248,8 @@ impl SimpleComponent for MainView {
|
||||||
set_visible: match mount_has_nosuid(&model.selected_profile.prefix) {
|
set_visible: match mount_has_nosuid(&model.selected_profile.prefix) {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
// TODO: handle this error better
|
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Warning: could not get stat on path {}",
|
"Warning (nosuid detection): could not get stat on path {}",
|
||||||
model.selected_profile.prefix.to_string_lossy());
|
model.selected_profile.prefix.to_string_lossy());
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue