Skip to content

Commit

Permalink
refined the drawing!
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Oct 12, 2023
1 parent c94d0bb commit ad92549
Showing 1 changed file with 38 additions and 27 deletions.
65 changes: 38 additions & 27 deletions internal/graph/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,25 @@ import (
"oras.land/oras-go/v2/internal/descriptor"
)

// A(manifest)-------------------+
//
// | |
// | |
// | |
// v |
//
// B(manifest)-----------------+ |
//
// | | |
// | | |
// v v v
//
// C(layer) D(layer)
// +------------------------------+
// | |
// | +-----------+ |
// | |A(manifest)| |
// | +-----+-----+ |
// | | |
// | +------------+ |
// | | | |
// | v v |
// | +-----+-----+ +---+----+ |
// | |B(manifest)| |C(layer)| |
// | +-----+-----+ +--------+ |
// | | |
// | v |
// | +---+----+ |
// | |D(layer)| |
// | +--------+ |
// | |
// |------------------------------+
func TestMemory_IndexAndRemove(t *testing.T) {
testFetcher := cas.NewMemory()
testMemory := NewMemory()
Expand Down Expand Up @@ -300,19 +305,25 @@ func TestMemory_IndexAndRemove(t *testing.T) {
}
}

/*
+---------A(index)--------+
| | |
| | |
| | |
| | |
v v v
B(manifest) C(manifest) D (manifest)
| | |
| | |
| | v
+-->E(layer)<-+------->F(layer)
*/
// +-----------------------------------------------+
// | |
// | +--------+ |
// | |A(index)| |
// | +---+----+ |
// | | |
// | -+--------------+--------------+- |
// | | | | |
// | +-----v-----+ +-----v-----+ +-----v-----+ |
// | |B(manifest)| |C(manifest)| |D(manifest)| |
// | +--------+--+ ++---------++ +--+--------+ |
// | | | | | |
// | | | | | |
// | v v v v |
// | ++------++ ++------++ |
// | |E(layer)| |F(layer)| |
// | +--------+ +--------+ |
// | |
// +-----------------------------------------------+
func TestMemory_IndexAllAndPredecessors(t *testing.T) {
testFetcher := cas.NewMemory()
testMemory := NewMemory()
Expand Down

0 comments on commit ad92549

Please sign in to comment.