diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-21 16:29:44 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-21 16:29:44 +0200 |
commit | 2887d66a939b3b8d7e84d9c71c0a86d5132b5e54 (patch) | |
tree | 763fcf337d7729e894f2f331dca7cbad52298b50 /recipe_test.go | |
parent | e3ba94744ed4f22e4a05f0757b624936602b70db (diff) | |
download | dna-backup-2887d66a939b3b8d7e84d9c71c0a86d5132b5e54.tar.gz dna-backup-2887d66a939b3b8d7e84d9c71c0a86d5132b5e54.zip |
change recipe into a generic slice patch/diff package
Diffstat (limited to 'recipe_test.go')
-rw-r--r-- | recipe_test.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/recipe_test.go b/recipe_test.go deleted file mode 100644 index f5c9b29..0000000 --- a/recipe_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import "testing" - -func TestRecipe(t *testing.T) { - c1 := &StoredChunk{Id: &ChunkId{0, 1}} - c2 := &StoredChunk{Id: &ChunkId{0, 2}} - c3 := &StoredChunk{Id: &ChunkId{0, 3}} - c4 := &StoredChunk{Id: &ChunkId{0, 4}} - c5 := &StoredChunk{Id: &ChunkId{0, 5}} - c6 := &StoredChunk{Id: &ChunkId{0, 6}} - c7 := &StoredChunk{Id: &ChunkId{0, 7}} - source := Recipe{c1, c2, c3, c4} - target := Recipe{c2, c5, c3, c6, c4, c7} - patch := diffRecipe(source, target) - assertSame(t, []RecipeDel{0}, patch.Del, "Patch del part") - assertSame(t, []RecipeIns{ - {1, []Chunk{c5}}, - {3, []Chunk{c6}}, - {5, []Chunk{c7}}, - }, patch.Ins, "Patch ins part") - actual := patchRecipe(source, patch) - assertSame(t, target, actual, "Target obtained from patch application") -} |