diff options
| author | 2026-03-25 14:49:17 +0000 | |
|---|---|---|
| committer | 2026-03-25 15:02:22 +0000 | |
| commit | 7847657e0820af98120031f719b8ede635ad8c07 (patch) | |
| tree | 8c4439c78f72f1382edc809b49be33115847b6e7 /object/commit_serialize_test.go | |
| parent | object: Remove type.go (diff) | |
| signature | No signature | |
object: Split each object type into its own package v0.1.108
Diffstat (limited to 'object/commit_serialize_test.go')
| -rw-r--r-- | object/commit_serialize_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/object/commit_serialize_test.go b/object/commit_serialize_test.go deleted file mode 100644 index cff47b40..00000000 --- a/object/commit_serialize_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package object_test - -import ( - "testing" - - "codeberg.org/lindenii/furgit/internal/testgit" - "codeberg.org/lindenii/furgit/object" - objectid "codeberg.org/lindenii/furgit/object/id" -) - -func TestCommitSerialize(t *testing.T) { - t.Parallel() - testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) { //nolint:thelper - testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true}) - _, _, commitID := testRepo.MakeCommit(t, "subject\n\nbody") - - rawBody := testRepo.CatFile(t, "commit", commitID) - - commit, err := object.ParseCommit(rawBody, algo) - if err != nil { - t.Fatalf("ParseCommit: %v", err) - } - - rawObj, err := commit.SerializeWithHeader() - if err != nil { - t.Fatalf("SerializeWithHeader: %v", err) - } - - gotID := algo.Sum(rawObj) - if gotID != commitID { - t.Fatalf("commit id mismatch: got %s want %s", gotID, commitID) - } - }) -} |
