From 167d8cac3dca2bc6037cc99aefb68ce84b130c54 Mon Sep 17 00:00:00 2001 From: Daniel Berg Date: Sun, 15 Dec 2024 18:35:36 +0100 Subject: [PATCH] ci: fix tests --- src/lib.rs | 4 ++-- tests/integration_test.rs | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e6292b4..d7e14d2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -73,10 +73,10 @@ use std::sync::atomic::{AtomicBool, Ordering}; /// use std::sync::atomic::Ordering; /// /// // Enable verbose output -/// VERBOSE.store(true, Ordering::Relaxed); +/// i3wsr_core::VERBOSE.store(true, Ordering::Relaxed); /// /// // Check if verbose is enabled -/// if VERBOSE.load(Ordering::Relaxed) { +/// if i3wsr_core::VERBOSE.load(Ordering::Relaxed) { /// println!("Verbose output enabled"); /// } /// ``` diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 49cf2dc..dd6e05b 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -1,18 +1,18 @@ use std::env; use std::error::Error; use swayipc::{Connection, WindowProperties}; -use i3wsr::{Config, update_tree}; +use i3wsr_core::{Config, update_tree}; #[test] fn connection_tree() -> Result<(), Box> { env::set_var("DISPLAY", ":99.0"); let mut conn = Connection::new()?; let config = Config::default(); - let res = i3wsr::regex::parse_config(&config)?; + let res = i3wsr_core::regex::parse_config(&config)?; assert!(update_tree(&mut conn, &config, &res).is_ok()); let tree = conn.get_tree()?; - let workspaces = i3wsr::get_workspaces(tree); + let workspaces = i3wsr_core::get_workspaces(tree); let name = workspaces.first() .and_then(|ws| ws.name.as_ref()) @@ -30,21 +30,21 @@ fn get_title() -> Result<(), Box> { let tree = conn.get_tree()?; let mut properties: Vec = Vec::new(); - let workspaces = i3wsr::get_workspaces(tree); + let workspaces = i3wsr_core::get_workspaces(tree); for workspace in &workspaces { let window_props = { - let mut f = i3wsr::get_properties(vec![workspace.floating_nodes.iter().collect()]); - let mut n = i3wsr::get_properties(vec![workspace.nodes.iter().collect()]); + let mut f = i3wsr_core::get_properties(vec![workspace.floating_nodes.iter().collect()]); + let mut n = i3wsr_core::get_properties(vec![workspace.nodes.iter().collect()]); n.append(&mut f); n }; properties.extend(window_props); } - let config = i3wsr::Config::default(); - let res = i3wsr::regex::parse_config(&config)?; + let config = i3wsr_core::Config::default(); + let res = i3wsr_core::regex::parse_config(&config)?; let result: Result, _> = properties .iter() - .map(|props| i3wsr::get_title(props, &config, &res)) + .map(|props| i3wsr_core::get_title(props, &config, &res)) .collect(); assert_eq!(result?, vec!["Gpick", "XTerm"]); Ok(()) @@ -55,12 +55,12 @@ fn collect_titles() -> Result<(), Box> { env::set_var("DISPLAY", ":99.0"); let mut conn = swayipc::Connection::new()?; let tree = conn.get_tree()?; - let workspaces = i3wsr::get_workspaces(tree); + let workspaces = i3wsr_core::get_workspaces(tree); let mut result: Vec> = Vec::new(); - let config = i3wsr::Config::default(); - let res = i3wsr::regex::parse_config(&config)?; + let config = i3wsr_core::Config::default(); + let res = i3wsr_core::regex::parse_config(&config)?; for workspace in workspaces { - result.push(i3wsr::collect_titles(&workspace, &config, &res)); + result.push(i3wsr_core::collect_titles(&workspace, &config, &res)); } let expected = vec![vec!["Gpick", "XTerm"]]; assert_eq!(result, expected); @@ -72,12 +72,12 @@ fn get_properties() -> Result<(), Box> { env::set_var("DISPLAY", ":99.0"); let mut conn = swayipc::Connection::new()?; let tree = conn.get_tree()?; - let workspaces = i3wsr::get_workspaces(tree); + let workspaces = i3wsr_core::get_workspaces(tree); let mut result: Vec = Vec::new(); for workspace in workspaces { let window_props = { - let mut f = i3wsr::get_properties(vec![workspace.floating_nodes.iter().collect()]); - let mut n = i3wsr::get_properties(vec![workspace.nodes.iter().collect()]); + let mut f = i3wsr_core::get_properties(vec![workspace.floating_nodes.iter().collect()]); + let mut n = i3wsr_core::get_properties(vec![workspace.nodes.iter().collect()]); n.append(&mut f); n };