agentmux_common/
platform_name.rs1pub fn platform_name() -> &'static str {
9 from_rust_os(std::env::consts::OS)
10}
11
12fn from_rust_os(os: &'static str) -> &'static str {
13 match os {
14 "macos" => "darwin",
15 "windows" => "win32",
16 other => other,
17 }
18}
19
20#[cfg(test)]
21mod tests {
22 use super::*;
23
24 #[test]
25 fn maps_rust_names_to_the_frontend_names() {
26 assert_eq!(from_rust_os("macos"), "darwin");
27 assert_eq!(from_rust_os("windows"), "win32");
28 assert_eq!(from_rust_os("linux"), "linux");
29 assert_eq!(from_rust_os("freebsd"), "freebsd");
30 }
31}