github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/idtools/idtools_test.go (about) 1 package idtools // import "github.com/demonoid81/moby/pkg/idtools" 2 3 import ( 4 "testing" 5 6 "gotest.tools/v3/assert" 7 ) 8 9 func TestCreateIDMapOrder(t *testing.T) { 10 subidRanges := ranges{ 11 {100000, 1000}, 12 {1000, 1}, 13 } 14 15 idMap := createIDMap(subidRanges) 16 assert.DeepEqual(t, idMap, []IDMap{ 17 { 18 ContainerID: 0, 19 HostID: 100000, 20 Size: 1000, 21 }, 22 { 23 ContainerID: 1000, 24 HostID: 1000, 25 Size: 1, 26 }, 27 }) 28 }