github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/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  }