github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/helper/freeport/ephemeral_darwin_test.go (about)

     1  //+build darwin
     2  
     3  package freeport
     4  
     5  import (
     6  	"testing"
     7  )
     8  
     9  func TestGetEphemeralPortRange(t *testing.T) {
    10  	min, max, err := getEphemeralPortRange()
    11  	if err != nil {
    12  		t.Fatalf("err: %v", err)
    13  	}
    14  	if min <= 0 || max <= 0 || min > max {
    15  		t.Fatalf("unexpected values: min=%d, max=%d", min, max)
    16  	}
    17  	t.Logf("min=%d, max=%d", min, max)
    18  }