github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/opts/address_pools_test.go (about)

     1  package opts // import "github.com/demonoid81/moby/opts"
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestAddressPoolOpt(t *testing.T) {
     8  	poolopt := &PoolsOpt{}
     9  	var addresspool = "base=175.30.0.0/16,size=16"
    10  	var invalidAddresspoolString = "base=175.30.0.0/16,size=16, base=175.33.0.0/16,size=24"
    11  
    12  	if err := poolopt.Set(addresspool); err != nil {
    13  		t.Fatal(err)
    14  	}
    15  
    16  	if err := poolopt.Set(invalidAddresspoolString); err == nil {
    17  		t.Fatal(err)
    18  	}
    19  
    20  }