From 0f56e014b7d911468f5010f8ff4ab8fb5df02646 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 15 Feb 2021 08:47:51 -0800 Subject: [PATCH] tests: some fixups to test_transaction as a result of reordering commits --- lib/tests/test_transaction.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tests/test_transaction.rs b/lib/tests/test_transaction.rs index 504fb648c..64065a46a 100644 --- a/lib/tests/test_transaction.rs +++ b/lib/tests/test_transaction.rs @@ -311,10 +311,10 @@ fn test_add_head_success(use_git: bool) { let mut tx = repo.start_transaction("test"); assert!(!tx.view().heads().contains(new_commit.id())); - assert!(!tx.as_repo_ref().index().has_id(new_commit.id())); + assert!(!tx.index().has_id(new_commit.id())); tx.add_head(&new_commit); assert!(tx.view().heads().contains(new_commit.id())); - assert!(tx.as_repo_ref().index().has_id(new_commit.id())); + assert!(tx.index().has_id(new_commit.id())); tx.commit(); Arc::get_mut(&mut repo).unwrap().reload(); assert!(repo.view().heads().contains(new_commit.id())); @@ -376,6 +376,9 @@ fn test_add_head_not_immediate_child(use_git: bool) { assert!(tx.view().heads().contains(initial.id())); assert!(!tx.view().heads().contains(rewritten.id())); assert!(tx.view().heads().contains(child.id())); + assert!(tx.index().has_id(initial.id())); + assert!(tx.index().has_id(rewritten.id())); + assert!(tx.index().has_id(child.id())); assert!(tx.evolution().is_obsolete(initial.id())); tx.discard(); }