summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-12-05 23:33:47 +0000
committerDan Davison <dandavison7@gmail.com>2020-12-05 23:33:47 +0000
commit1e887f2daa35f961bf0d824151c6d9ecb2d7b422 (patch)
treeccc6505adb867854f6d8a6af664a82d5539f7038
parenta83c933878b9ad948527e27bdb915fc74c36b109 (diff)
Fix test on Windows
-rw-r--r--src/features/hyperlinks.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/features/hyperlinks.rs b/src/features/hyperlinks.rs
index 5758c5e7..fb7c1677 100644
--- a/src/features/hyperlinks.rs
+++ b/src/features/hyperlinks.rs
@@ -93,7 +93,7 @@ mod tests {
use super::*;
use crate::tests::integration_test_utils::integration_test_utils::make_config_from_args_and_git_config;
use std::fs::remove_file;
- use std::path::PathBuf;
+ use std::path::{Path, PathBuf};
#[test]
fn test_format_commit_line_with_osc8_commit_hyperlink() {
@@ -125,7 +125,10 @@ mod tests {
GitConfigEntry::Path(PathBuf::from("/working/directory")),
);
assert_eq!(
- "\x1b]8;;file:///working/directory/relative/path/file.rs\x1b\\link-text\x1b]8;;\x1b\\",
+ format!(
+ "\x1b]8;;file://{}\x1b\\link-text\x1b]8;;\x1b\\",
+ Path::new("/working/directory/relative/path/file.rs").to_string_lossy()
+ ),
format_osc8_file_hyperlink("relative/path/file.rs", None, "link-text", &config)
)
}
@@ -142,7 +145,10 @@ mod tests {
GitConfigEntry::Path(PathBuf::from("/working/directory")),
);
assert_eq!(
- "\x1b]8;;file-line:///working/directory/relative/path/file.rs:7\x1b\\link-text\x1b]8;;\x1b\\",
+ format!(
+ "\x1b]8;;file-line://{}:7\x1b\\link-text\x1b]8;;\x1b\\",
+ Path::new("/working/directory/relative/path/file.rs").to_string_lossy()
+ ),
format_osc8_file_hyperlink("relative/path/file.rs", Some(7), "link-text", &config)
)
}