From af086093bfd4018e0f7e3cec837837eb88c4499b Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Wed, 31 Jul 2024 17:41:13 +0900 Subject: [PATCH] tests: rerun commit.diff() template test with --color=debug The added test shows the "diff" label is repeated because of auto-labeling of templater. The original "--color=always" test is also kept to ensure that color sequences are unchanged even if we remove one of the "diff" labels. --- cli/tests/test_commit_template.rs | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/cli/tests/test_commit_template.rs b/cli/tests/test_commit_template.rs index a6641f0075..5114fd244e 100644 --- a/cli/tests/test_commit_template.rs +++ b/cli/tests/test_commit_template.rs @@ -1008,6 +1008,46 @@ fn test_log_diff_predefined_formats() { M file2 "###); + // color labels + let stdout = test_env.jj_cmd_success( + &repo_path, + &["log", "--no-graph", "--color=debug", "-r@", "-T", template], + ); + insta::assert_snapshot!(stdout, @r###" + <> + <> + <><><><> + <><><><> + <><><><> + <> + <><><><><><><> + <><><><> + <> + <> + <> + <> + <> + <> + <> + <> + <><> + <> + <> + <> + <> + <> + <><><> + <><><> + <><> + <> + <><><> + <><><> + <> + <> + <> + <> + "###); + // cwd != workspace root let stdout = test_env.jj_cmd_success( test_env.env_root(),