main_test.go 302 B

123456789101112
  1. package main
  2. import "testing"
  3. func TestEffectiveHTTPPort(t *testing.T) {
  4. if got := effectiveHTTPPort(80, 8081, false); got != 8081 {
  5. t.Fatalf("configured port ignored: %d", got)
  6. }
  7. if got := effectiveHTTPPort(9090, 8081, true); got != 9090 {
  8. t.Fatalf("explicit override ignored: %d", got)
  9. }
  10. }