mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 18:47:20 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			247 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			247 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import (
 | |
| 	"runtime"
 | |
| 	"testing"
 | |
| )
 | |
| 
 | |
| func TestNumProcs(t *testing.T) {
 | |
| 	num := runtime.NumCPU()
 | |
| 	n := numProcs()
 | |
| 	if num > 1 && n != num-1 {
 | |
| 		t.Errorf("Expected numProcs to return max(NumCPU-1, 0) but got %d (NumCPU=%d)", n, num)
 | |
| 	}
 | |
| }
 |