Skip to content

Commit 971e2e9

Browse files
committed
server: keep IPC path tests after implementation
1 parent 58a629a commit 971e2e9

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎crates/server/src/ipc/ipc_unix.rs‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,6 @@ pub fn default_ipc_path_for(name: &crate::ServerName) -> String {
2323
format!("/tmp/{socket}")
2424
}
2525

26-
#[cfg(test)]
27-
mod path_tests {
28-
use super::*;
29-
30-
#[test]
31-
fn named_socket_has_an_instance_suffix() {
32-
let name: crate::ServerName = "work".parse().unwrap();
33-
let path = default_ipc_path_for(&name);
34-
assert!(path.ends_with("blit-work.sock"), "{path}");
35-
assert_ne!(path, default_ipc_path());
36-
}
37-
38-
#[test]
39-
fn default_socket_has_the_default_instance_suffix() {
40-
assert!(default_ipc_path().ends_with("blit-default.sock"));
41-
}
42-
}
43-
4426
pub struct IpcListener {
4527
inner: UnixListener,
4628
/// Held for the process lifetime so the flock is released on exit.
@@ -244,3 +226,21 @@ pub async fn run_fd_channel(channel_fd: RawFd, state: crate::AppState) {
244226
eprintln!("fd-channel closed, shutting down");
245227
}
246228
}
229+
230+
#[cfg(test)]
231+
mod path_tests {
232+
use super::*;
233+
234+
#[test]
235+
fn named_socket_has_an_instance_suffix() {
236+
let name: crate::ServerName = "work".parse().unwrap();
237+
let path = default_ipc_path_for(&name);
238+
assert!(path.ends_with("blit-work.sock"), "{path}");
239+
assert_ne!(path, default_ipc_path());
240+
}
241+
242+
#[test]
243+
fn default_socket_has_the_default_instance_suffix() {
244+
assert!(default_ipc_path().ends_with("blit-default.sock"));
245+
}
246+
}

0 commit comments

Comments
 (0)