diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-05-25 23:28:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-25 23:28:53 -0400 |
commit | ebe08f9a6d7156e6e1f4504f38f4652426fdb50e (patch) | |
tree | 81f209d9ffcac4677fffb64ce0457b97533903b8 /src/tests/test_example_diffs.rs | |
parent | 6be96be6b9af9ababc67835a35d8685d2fc6867d (diff) |
Add hyperlinks-commit-link-format option (#614)
* Refactor: hyperlinks utility
* Add hyperlinks-commit-link-format option
Fixes #613
Diffstat (limited to 'src/tests/test_example_diffs.rs')
-rw-r--r-- | src/tests/test_example_diffs.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs index 82b12f52..7c7192e6 100644 --- a/src/tests/test_example_diffs.rs +++ b/src/tests/test_example_diffs.rs @@ -1591,6 +1591,23 @@ src/align.rs:71: impl<'a> Alignment<'a> { │ assert!(output.contains(r"src/delta.rs: mode -x")); } + #[test] + fn test_hyperlinks_commit_link_format() { + let config = integration_test_utils::make_config_from_args(&[ + // If commit-style is not set then the commit line is handled in raw + // mode, in which case we only format hyperlinks if output is a tty; + // this causes the test to fail on Github Actions, but pass locally + // if output is left going to the screen. + "--commit-style", + "blue", + "--hyperlinks", + "--hyperlinks-commit-link-format", + "https://invent.kde.org/utilities/konsole/-/commit/{commit}", + ]); + let output = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, &config); + assert!(output.contains(r"https://invent.kde.org/utilities/konsole/-/commit/94907c0f136f46dc46ffae2dc92dca9af7eb7c2e")); + } + const GIT_DIFF_SINGLE_HUNK: &str = "\ commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e Author: Dan Davison <dandavison7@gmail.com> |