()
| 286 | #[test] |
| 287 | #[allow(unsafe_code)] |
| 288 | fn last_sandbox_path_layout() { |
| 289 | let _guard = crate::XDG_TEST_LOCK |
| 290 | .lock() |
| 291 | .unwrap_or_else(std::sync::PoisonError::into_inner); |
| 292 | let tmp = tempfile::tempdir().unwrap(); |
| 293 | let orig = std::env::var("XDG_CONFIG_HOME").ok(); |
| 294 | unsafe { |
| 295 | std::env::set_var("XDG_CONFIG_HOME", tmp.path()); |
| 296 | } |
| 297 | let path = last_sandbox_path("my-gateway").unwrap(); |
| 298 | assert!( |
| 299 | path.ends_with("openshell/gateways/my-gateway/last_sandbox"), |
| 300 | "unexpected path: {path:?}" |
| 301 | ); |
| 302 | unsafe { |
| 303 | match orig { |
| 304 | Some(v) => std::env::set_var("XDG_CONFIG_HOME", v), |
| 305 | None => std::env::remove_var("XDG_CONFIG_HOME"), |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | #[allow(unsafe_code)] |
| 311 | #[test] |
nothing calls this directly
no test coverage detected