Skip to content

Commit

Permalink
Fix test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Dec 5, 2020
1 parent a83c933 commit 1e887f2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/features/hyperlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
)
}
Expand All @@ -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)
)
}
Expand Down

0 comments on commit 1e887f2

Please sign in to comment.