From 36336bf94155b9c8473b0ff15affe9d679cbe1e2 Mon Sep 17 00:00:00 2001 From: Ahmed Hesham Abdelkader <23265119+ahmedhesham6@users.noreply.github.com> Date: Mon, 12 Jan 2026 17:51:32 +0100 Subject: [PATCH 1/3] fix: use cross-platform path assertions in config tests Replace string-based path assertions with idiomatic Rust Path::ends_with() and Path::join() to fix test failures on Windows where path separators differ from Unix. --- apps/cli/src/commands/core/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/cli/src/commands/core/config.rs b/apps/cli/src/commands/core/config.rs index 1ed150e..6eb565f 100644 --- a/apps/cli/src/commands/core/config.rs +++ b/apps/cli/src/commands/core/config.rs @@ -8,7 +8,7 @@ use anyhow::{Context, Result}; use clap::ValueEnum; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::process::Command; /// Installation scope for skills @@ -620,7 +620,7 @@ project_skills_dir = ".custom/skills" let result = config .resolve_skills_dir(Scope::Global, None, Some("~/custom/path")) .unwrap(); - assert!(result.to_string_lossy().contains("custom/path")); + assert!(result.ends_with(Path::new("custom").join("path"))); // Even with project scope, explicit dir wins let result = config @@ -637,7 +637,7 @@ project_skills_dir = ".custom/skills" let result = config .resolve_skills_dir(Scope::Global, Some("claude-code"), None) .unwrap(); - assert!(result.to_string_lossy().contains(".claude/skills")); + assert!(result.ends_with(Path::new(".claude").join("skills"))); } #[test] @@ -649,7 +649,7 @@ project_skills_dir = ".custom/skills" let result = config .resolve_skills_dir(Scope::Global, None, None) .unwrap(); - assert!(result.to_string_lossy().contains(".cursor/skills")); + assert!(result.ends_with(Path::new(".cursor").join("skills"))); } #[test] @@ -660,7 +660,7 @@ project_skills_dir = ".custom/skills" let result = config .resolve_skills_dir(Scope::Global, None, None) .unwrap(); - assert!(result.to_string_lossy().contains(".agents/skills")); + assert!(result.ends_with(Path::new(".agents").join("skills"))); } #[test] @@ -672,7 +672,7 @@ project_skills_dir = ".custom/skills" #[test] fn test_default_skills_dir() { let dir = Config::default_skills_dir(); - assert!(dir.to_string_lossy().contains(".agents/skills")); + assert!(dir.ends_with(Path::new(".agents").join("skills"))); } #[test] From 8d4e271c06e63fc3b4164738b72647718206d062 Mon Sep 17 00:00:00 2001 From: Ahmed Hesham Abdelkader <23265119+ahmedhesham6@users.noreply.github.com> Date: Mon, 12 Jan 2026 19:14:50 +0100 Subject: [PATCH 2/3] lint --- apps/cli/src/commands/core/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/cli/src/commands/core/config.rs b/apps/cli/src/commands/core/config.rs index 6eb565f..98afbf6 100644 --- a/apps/cli/src/commands/core/config.rs +++ b/apps/cli/src/commands/core/config.rs @@ -8,7 +8,7 @@ use anyhow::{Context, Result}; use clap::ValueEnum; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use std::process::Command; /// Installation scope for skills @@ -400,7 +400,7 @@ impl Config { /// Priority: /// 1. Explicit scope flag /// 2. Project config default_scope - /// 3. Global config default_scope + /// 3. Global config default_scope /// 4. Hardcoded default: Global pub fn effective_scope(&self, explicit_scope: Option) -> Scope { explicit_scope From c10fa12661163b520882574d96194a6233b3bf1a Mon Sep 17 00:00:00 2001 From: Ahmed Hesham Abdelkader <23265119+ahmedhesham6@users.noreply.github.com> Date: Tue, 13 Jan 2026 00:03:05 +0100 Subject: [PATCH 3/3] Add Path to config tests module --- apps/cli/src/commands/core/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/cli/src/commands/core/config.rs b/apps/cli/src/commands/core/config.rs index 98afbf6..03bcf11 100644 --- a/apps/cli/src/commands/core/config.rs +++ b/apps/cli/src/commands/core/config.rs @@ -481,6 +481,7 @@ impl Config { #[cfg(test)] mod tests { use super::*; + use std::path::Path; #[test] fn test_default_config_has_builtin_agents() {