Set up Go module and move Rust to legacy
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
use crate::domain::EvidenceHealth;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct WindowSnapshot {
|
||||
pub title: String,
|
||||
pub class: Option<String>,
|
||||
pub health: EvidenceHealth,
|
||||
}
|
||||
|
||||
impl WindowSnapshot {
|
||||
pub fn unavailable(reason: impl Into<String>) -> Self {
|
||||
Self {
|
||||
title: "none".to_string(),
|
||||
class: None,
|
||||
health: EvidenceHealth::Unavailable(reason.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
mod windows;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use windows::*;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
mod linux;
|
||||
#[cfg(target_os = "linux")]
|
||||
pub use linux::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn unavailable_snapshot_records_reason_without_evidence() {
|
||||
assert_eq!(
|
||||
WindowSnapshot::unavailable("no active window"),
|
||||
WindowSnapshot {
|
||||
title: "none".to_string(),
|
||||
class: None,
|
||||
health: EvidenceHealth::Unavailable("no active window".to_string()),
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user