summaryrefslogtreecommitdiffstats
path: root/src/features/hyperlinks.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/hyperlinks.rs')
-rw-r--r--src/features/hyperlinks.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/features/hyperlinks.rs b/src/features/hyperlinks.rs
index fb7c1677..46e0984d 100644
--- a/src/features/hyperlinks.rs
+++ b/src/features/hyperlinks.rs
@@ -124,6 +124,27 @@ mod tests {
"delta.__workdir__".to_string(),
GitConfigEntry::Path(PathBuf::from("/working/directory")),
);
+ println!(
+ "{}",
+ format!(
+ "\x1b]8;;file://{}\x1b\\link-text\x1b]8;;\x1b\\",
+ Path::new("/working/directory/relative/path/file.rs").to_string_lossy()
+ )
+ );
+ println!(
+ "{}",
+ format_osc8_file_hyperlink("relative/path/file.rs", None, "link-text", &config)
+ );
+ dbg!(format!(
+ "\x1b]8;;file://{}\x1b\\link-text\x1b]8;;\x1b\\",
+ Path::new("/working/directory/relative/path/file.rs").to_string_lossy()
+ ));
+ dbg!(format_osc8_file_hyperlink(
+ "relative/path/file.rs",
+ None,
+ "link-text",
+ &config
+ ));
assert_eq!(
format!(
"\x1b]8;;file://{}\x1b\\link-text\x1b]8;;\x1b\\",