path

Macro path 

Source
path!() { /* proc-macro */ }
Expand description

A macro used in tests for cross-platform path string literals in tests. On Windows it replaces / with \\ and adds C: to the beginning of absolute paths. On other platforms, the path is returned unmodified.

ยงExample

use zed_util_macros::path;

let path = path!("/Users/user/file.txt");
#[cfg(target_os = "windows")]
assert_eq!(path, "C:\\Users\\user\\file.txt");
#[cfg(not(target_os = "windows"))]
assert_eq!(path, "/Users/user/file.txt");