From 87840a5c2c8234ca70b3f1429faa61fb7eafce01 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 4 Oct 2024 06:19:23 +0200 Subject: [PATCH] testutils: add short method summary to its documentation --- lib/testutils/src/lib.rs | 2 ++ lib/testutils/src/test_backend.rs | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/testutils/src/lib.rs b/lib/testutils/src/lib.rs index ae74b427e..d2966a541 100644 --- a/lib/testutils/src/lib.rs +++ b/lib/testutils/src/lib.rs @@ -531,6 +531,8 @@ pub fn assert_rebased_onto( new_commit } +/// Maps children of an abandoned commit to a new rebase target. +/// /// If `expected_old_commit` was abandoned, the `rebased` map indicates the /// commit the children of `expected_old_commit` should be rebased to, which /// would have a different change id. This happens when the EmptyBehavior in diff --git a/lib/testutils/src/test_backend.rs b/lib/testutils/src/test_backend.rs index c4e9ac115..1630cb4db 100644 --- a/lib/testutils/src/test_backend.rs +++ b/lib/testutils/src/test_backend.rs @@ -78,11 +78,14 @@ fn get_hash(content: &(impl jj_lib::content_hash::ContentHash + ?Sized)) -> Vec< jj_lib::content_hash::blake2b_hash(content).as_slice()[..HASH_LENGTH].to_vec() } -/// A commit backend for use in tests. It's meant to be strict, in order to -/// catch bugs where we make the wrong assumptions. For example, unlike both -/// `GitBackend` and `LocalBackend`, this backend doesn't share objects written -/// to different paths (writing a file with contents X to path A will not make -/// it possible to read that contents from path B given the same `FileId`). +/// A commit backend for use in tests. +/// +/// It's meant to be strict, in order to catch bugs where we make the +/// wrong assumptions. For example, unlike both `GitBackend` and +/// `LocalBackend`, this backend doesn't share objects written to +/// different paths (writing a file with contents X to path A will not +/// make it possible to read that contents from path B given the same +/// `FileId`). pub struct TestBackend { root_commit_id: CommitId, root_change_id: ChangeId,