mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-24 06:19:42 +00:00
revset: inline resolve/evaluate_programmatic() in tests
I'm going to replace the current .evaluate_programmatic() which does minimal commit-ref resolution. The new .evaluate_programmatic() will be implemented on a "resolved" expression.
This commit is contained in:
parent
7d1041c9d5
commit
e819cec305
1 changed files with 12 additions and 4 deletions
|
@ -457,7 +457,9 @@ fn test_resolve_working_copy() {
|
|||
assert_eq!(
|
||||
RevsetExpression::working_copy(ws1.clone())
|
||||
.present()
|
||||
.evaluate_programmatic(mut_repo)
|
||||
.resolve_user_expression(mut_repo, &FailingSymbolResolver)
|
||||
.unwrap()
|
||||
.evaluate(mut_repo)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(Result::unwrap)
|
||||
|
@ -474,7 +476,9 @@ fn test_resolve_working_copy() {
|
|||
.unwrap();
|
||||
let resolve = |ws_id: WorkspaceId| -> Vec<CommitId> {
|
||||
RevsetExpression::working_copy(ws_id)
|
||||
.evaluate_programmatic(mut_repo)
|
||||
.resolve_user_expression(mut_repo, &FailingSymbolResolver)
|
||||
.unwrap()
|
||||
.evaluate(mut_repo)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(Result::unwrap)
|
||||
|
@ -512,7 +516,9 @@ fn test_resolve_working_copies() {
|
|||
.unwrap();
|
||||
let resolve = || -> Vec<CommitId> {
|
||||
RevsetExpression::working_copies()
|
||||
.evaluate_programmatic(mut_repo)
|
||||
.resolve_user_expression(mut_repo, &FailingSymbolResolver)
|
||||
.unwrap()
|
||||
.evaluate(mut_repo)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(Result::unwrap)
|
||||
|
@ -1008,7 +1014,9 @@ fn test_evaluate_expression_root_and_checkout() {
|
|||
);
|
||||
|
||||
// Shouldn't panic by unindexed commit ID
|
||||
let expression = RevsetExpression::commit(commit1.id().clone()).resolve_programmatic(tx.repo());
|
||||
let expression = RevsetExpression::commit(commit1.id().clone())
|
||||
.resolve_user_expression(tx.repo(), &FailingSymbolResolver)
|
||||
.unwrap();
|
||||
assert!(expression.evaluate(tx.base_repo().as_ref()).is_err());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue