-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Split out ascii template versions and migrate config to toml
This should hopefully unblock jj-vcs#3381.
- Loading branch information
Showing
6 changed files
with
82 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,13 +93,45 @@ fn test_op_log() { | |
"###); | ||
} | ||
|
||
#[test] | ||
fn test_op_log_default_ascii_symbols() { | ||
let test_env = TestEnvironment::default(); | ||
test_env.jj_cmd_ok(test_env.env_root(), &["init", "repo", "--git"]); | ||
let repo_path = test_env.env_root().join("repo"); | ||
test_env.jj_cmd_ok(&repo_path, &["describe", "-m", "description 0"]); | ||
|
||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&[ | ||
"op", | ||
"log", | ||
"--config-toml", | ||
concat!( | ||
"template-aliases.'format_time_range(x)' = 'x'\n", | ||
"ui.graph.style = 'ascii'\n", | ||
), | ||
], | ||
); | ||
insta::assert_snapshot!(&stdout, @r###" | ||
@ 52ac15d375ba [email protected] 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00 | ||
| describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 | ||
| args: jj describe -m 'description 0' | ||
o b51416386f26 [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
| add workspace 'default' | ||
o 9a7d829846af [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
| initialize repo | ||
o 000000000000 root() | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_op_log_with_custom_symbols() { | ||
let test_env = TestEnvironment::default(); | ||
test_env.jj_cmd_ok(test_env.env_root(), &["init", "repo", "--git"]); | ||
let repo_path = test_env.env_root().join("repo"); | ||
test_env.jj_cmd_ok(&repo_path, &["describe", "-m", "description 0"]); | ||
|
||
// Custom symbols. | ||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&[ | ||
|
@@ -122,6 +154,32 @@ fn test_op_log_with_custom_symbols() { | |
│ initialize repo | ||
┴ 000000000000 root() | ||
"###); | ||
|
||
// Custom symbols, ascii. | ||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&[ | ||
"op", | ||
"log", | ||
"--config-toml", | ||
concat!( | ||
"template-aliases.'format_time_range(x)' = 'x'\n", | ||
"ui.graph.style = 'ascii'\n", | ||
"templates.op_log_node_ascii = 'if(current_operation, \"v\", if(root, \"^\", \ | ||
\">\"))'", | ||
), | ||
], | ||
); | ||
insta::assert_snapshot!(&stdout, @r###" | ||
v 52ac15d375ba [email protected] 2001-02-03 04:05:08.000 +07:00 - 2001-02-03 04:05:08.000 +07:00 | ||
| describe commit 230dd059e1b059aefc0da06a2e5a7dbf22362f22 | ||
| args: jj describe -m 'description 0' | ||
> b51416386f26 [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
| add workspace 'default' | ||
> 9a7d829846af [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
| initialize repo | ||
^ 000000000000 root() | ||
"###); | ||
} | ||
|
||
#[test] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters