ok/jj
1
0
Fork 0
forked from mirrors/jj

test_global_opts: make test_version just a bit nicer when it fails

This commit is contained in:
Ilya Grigoriev 2024-02-02 22:08:00 -08:00
parent 42e6132771
commit 8a4b3966a6

View file

@ -48,10 +48,13 @@ fn test_version() {
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["--version"]);
let sanitized = stdout.replace(|c: char| c.is_ascii_hexdigit(), "?");
let expected = [
"jj ?.??.?\n",
"jj ?.??.?-????????????????????????????????????????\n",
];
assert!(
sanitized == "jj ?.??.?\n"
|| sanitized == "jj ?.??.?-????????????????????????????????????????\n",
"{sanitized}"
expected.contains(&sanitized.as_str()),
"`jj version` output: {stdout:?}.\nSanitized: {sanitized:?}\nExpected one of: {expected:?}"
);
}