caddy/dist/automate_test.go

15 lines
247 B
Go
Raw Normal View History

2016-06-21 14:11:55 +08:00
package main
import (
"runtime"
"testing"
)
func TestNumProcs(t *testing.T) {
2016-06-21 14:23:18 +08:00
num := runtime.NumCPU()
2016-06-21 14:11:55 +08:00
n := numProcs()
2016-06-21 14:23:18 +08:00
if num > 1 && n != num-1 {
t.Errorf("Expected numProcs to return max(NumCPU-1, 0) but got %d (NumCPU=%d)", n, num)
2016-06-21 14:11:55 +08:00
}
}