gcc/libgo/go/os/signal/signal_test.go
Ian Lance Taylor adb0401dac Update Go library to r60.
From-SVN: r178910
2011-09-16 15:47:21 +00:00

21 lines
480 B
Go

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package signal
import (
"os"
"syscall"
"testing"
)
func TestSignal(t *testing.T) {
// Send this process a SIGHUP.
syscall.Syscall(syscall.SYS_KILL, uintptr(syscall.Getpid()), syscall.SIGHUP, 0)
if sig := (<-Incoming).(os.UnixSignal); sig != os.SIGHUP {
t.Errorf("signal was %v, want %v", sig, os.SIGHUP)
}
}