mirror of
https://github.com/martinvonz/jj.git
synced 2024-10-24 07:32:54 +00:00
test_global_opts: extract --version to its own test
This commit is contained in:
parent
42c85b33c7
commit
42e6132771
1 changed files with 13 additions and 8 deletions
|
@ -42,6 +42,19 @@ fn test_non_utf8_arg() {
|
|||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_version() {
|
||||
let test_env = TestEnvironment::default();
|
||||
|
||||
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["--version"]);
|
||||
let sanitized = stdout.replace(|c: char| c.is_ascii_hexdigit(), "?");
|
||||
assert!(
|
||||
sanitized == "jj ?.??.?\n"
|
||||
|| sanitized == "jj ?.??.?-????????????????????????????????????????\n",
|
||||
"{sanitized}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_no_subcommand() {
|
||||
let test_env = TestEnvironment::default();
|
||||
|
@ -65,14 +78,6 @@ fn test_no_subcommand() {
|
|||
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["--help"]);
|
||||
insta::assert_snapshot!(stdout.lines().next().unwrap(), @"Jujutsu (An experimental VCS)");
|
||||
|
||||
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["--version"]);
|
||||
let sanitized = stdout.replace(|c: char| c.is_ascii_hexdigit(), "?");
|
||||
assert!(
|
||||
sanitized == "jj ?.??.?\n"
|
||||
|| sanitized == "jj ?.??.?-????????????????????????????????????????\n",
|
||||
"{sanitized}"
|
||||
);
|
||||
|
||||
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["-R", "repo"]);
|
||||
assert_eq!(stdout, test_env.jj_cmd_success(&repo_path, &["log"]));
|
||||
|
||||
|
|
Loading…
Reference in a new issue