Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use test backend in more tests #2276

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions lib/tests/test_merged_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use jj_lib::repo::Repo;
use jj_lib::repo_path::{RepoPath, RepoPathComponent, RepoPathJoin};
use jj_lib::tree::merge_trees;
use pretty_assertions::assert_eq;
use testutils::{create_single_tree, write_file, TestRepo, TestRepoBackend};
use testutils::{create_single_tree, write_file, TestRepo};

fn file_value(file_id: &FileId) -> TreeValue {
TreeValue::File {
Expand All @@ -32,7 +32,7 @@ fn file_value(file_id: &FileId) -> TreeValue {

#[test]
fn test_from_legacy_tree() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;
let store = repo.store();

Expand Down Expand Up @@ -223,7 +223,7 @@ fn test_from_legacy_tree() {

#[test]
fn test_path_value_and_entries() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

// Create a MergedTree
Expand Down Expand Up @@ -348,7 +348,7 @@ fn test_path_value_and_entries() {

#[test]
fn test_resolve_success() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let unchanged_path = RepoPath::from_internal_string("unchanged");
Expand Down Expand Up @@ -415,7 +415,7 @@ fn test_resolve_success() {

#[test]
fn test_resolve_root_becomes_empty() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;
let store = repo.store();

Expand All @@ -432,7 +432,7 @@ fn test_resolve_root_becomes_empty() {

#[test]
fn test_resolve_with_conflict() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

// The trivial conflict should be resolved but the non-trivial should not (and
Expand All @@ -459,7 +459,7 @@ fn test_resolve_with_conflict() {

#[test]
fn test_conflict_iterator() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let unchanged_path = RepoPath::from_internal_string("dir/subdir/unchanged");
Expand Down Expand Up @@ -575,7 +575,7 @@ fn test_conflict_iterator() {
}
#[test]
fn test_conflict_iterator_higher_arity() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let two_sided_path = RepoPath::from_internal_string("dir/2-sided");
Expand Down Expand Up @@ -652,7 +652,7 @@ fn test_conflict_iterator_higher_arity() {
/// Diff two resolved trees
#[test]
fn test_diff_resolved() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let clean_path = RepoPath::from_internal_string("dir1/file");
Expand Down Expand Up @@ -711,7 +711,7 @@ fn test_diff_resolved() {
/// Diff two conflicted trees
#[test]
fn test_diff_conflicted() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

// path1 is a clean (unchanged) conflict
Expand Down Expand Up @@ -816,7 +816,7 @@ fn test_diff_conflicted() {

#[test]
fn test_diff_dir_file() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

// path1: file1 -> directory1
Expand Down Expand Up @@ -1048,7 +1048,7 @@ fn test_diff_dir_file() {
/// Merge 3 resolved trees that can be resolved
#[test]
fn test_merge_simple() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let path1 = RepoPath::from_internal_string("dir1/file");
Expand All @@ -1069,7 +1069,7 @@ fn test_merge_simple() {
/// Merge 3 resolved trees that can be partially resolved
#[test]
fn test_merge_partial_resolution() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

// path1 can be resolved, path2 cannot
Expand All @@ -1096,7 +1096,7 @@ fn test_merge_partial_resolution() {
/// Merge 3 resolved trees, including one empty legacy tree
#[test]
fn test_merge_with_empty_legacy_tree() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let path1 = RepoPath::from_internal_string("dir1/file");
Expand All @@ -1121,7 +1121,7 @@ fn test_merge_with_empty_legacy_tree() {
/// at by only simplifying the conflict (no need to recurse)
#[test]
fn test_merge_simplify_only() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

let path = RepoPath::from_internal_string("dir1/file");
Expand Down Expand Up @@ -1154,7 +1154,7 @@ fn test_merge_simplify_only() {
/// result is a 3-way conflict.
#[test]
fn test_merge_simplify_result() {
let test_repo = TestRepo::init_with_backend(TestRepoBackend::Test);
let test_repo = TestRepo::init();
let repo = &test_repo.repo;

// The conflict in path1 cannot be resolved, but the conflict in path2 can.
Expand Down
Loading