chore: remove some comments; remove unnecessary test with sleep; detail could not get stat warning

This commit is contained in:
Gabriele Musco 2024-08-06 14:27:38 +02:00
parent cf2fa339ad
commit a14b44d176
4 changed files with 3 additions and 22 deletions

View file

@ -222,24 +222,7 @@ mod tests {
use crate::profile::Profile;
use crate::runner::Runner;
use core::time;
use std::{collections::HashMap, 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");
}
use std::{path::Path, thread::sleep};
#[test]
fn can_save_log() {

View file

@ -33,7 +33,7 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
Config {
// TODO: handle first start with no profile selected
// TODO: using an empty string here is ugly
selected_profile_uuid: "".to_string(),
debug_view_enabled: false,
user_profiles: vec![],

View file

@ -86,7 +86,6 @@ impl AsyncFactoryComponent for DeviceRowModel {
view! {
root = adw::ActionRow {
// TODO: replace with flat button that spawns popover
add_prefix: icon = &gtk::Image {
set_icon_name: Some(self.state.icon()),
},

View file

@ -248,9 +248,8 @@ impl SimpleComponent for MainView {
set_visible: match mount_has_nosuid(&model.selected_profile.prefix) {
Ok(b) => b,
Err(_) => {
// TODO: handle this error better
eprintln!(
"Warning: could not get stat on path {}",
"Warning (nosuid detection): could not get stat on path {}",
model.selected_profile.prefix.to_string_lossy());
false
},