mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-17 13:14:26 +00:00
tests: make timestamp().ago()
test independent of graph style
This commit is contained in:
parent
aefd0fe69e
commit
990d87fad5
@ -43,8 +43,16 @@ fn test_log_author_timestamp_ago() {
|
||||
test_env.jj_cmd_success(&repo_path, &["describe", "-m", "first"]);
|
||||
test_env.jj_cmd_success(&repo_path, &["new", "-m", "second"]);
|
||||
|
||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "author.timestamp().ago()"]);
|
||||
let line_re = Regex::new(r"@|o [0-9]+ years ago").unwrap();
|
||||
let stdout = test_env.jj_cmd_success(
|
||||
&repo_path,
|
||||
&[
|
||||
"log",
|
||||
"--no-graph",
|
||||
"-T",
|
||||
r#"author.timestamp().ago() "\\n""#,
|
||||
],
|
||||
);
|
||||
let line_re = Regex::new(r"[0-9]+ years ago").unwrap();
|
||||
assert!(
|
||||
stdout.lines().all(|x| line_re.is_match(x)),
|
||||
"expected every line to match regex"
|
||||
|
Loading…
x
Reference in New Issue
Block a user