Source file src/runtime/signal_test.go
1 // Copyright 2026 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 package runtime_test 6 7 import ( 8 "runtime" 9 "testing" 10 ) 11 12 func TestSignalBogus(t *testing.T) { 13 if runtime.GOOS == "plan9" { 14 t.Skip("No syscall.Signal on plan9") 15 } 16 17 // This test more properly belongs in os/signal, but it depends on 18 // containing the only call to signal.Notify in the process, so it must 19 // run as an isolated subprocess, which is simplest with testprog. 20 t.Parallel() 21 output := runTestProg(t, "testprog", "SignalBogus") 22 want := "OK\n" 23 if output != want { 24 t.Fatalf("output is not %q\n%s", want, output) 25 } 26 } 27