golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/coordinator/builders_test.go (about) 1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build linux || darwin 6 7 package main 8 9 import ( 10 "net/http/httptest" 11 "testing" 12 ) 13 14 func TestHandleBuilders(t *testing.T) { 15 rec := httptest.NewRecorder() 16 handleBuilders(rec, httptest.NewRequest("GET", "/builders", nil)) 17 res := rec.Result() 18 if res.StatusCode != 200 { 19 t.Fatalf("Want 200 OK. Got status: %v, %s", res.Status, rec.Body.Bytes()) 20 } 21 t.Logf("Got: %s", rec.Body.Bytes()) 22 }