From a858e94f602ca0824951d4baff441cd13c594e9e Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 21 Jun 2018 11:13:53 +0200 Subject: [bug] add windows support to the pid file - Resolves: #43 --- pid_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pid_test.go (limited to 'pid_test.go') diff --git a/pid_test.go b/pid_test.go new file mode 100644 index 0000000..2c92641 --- /dev/null +++ b/pid_test.go @@ -0,0 +1,21 @@ +package main + +import ( + "syscall" + "testing" +) + +const ( + invalidPid = 345678 +) + +func TestPidRunning(t *testing.T) { + pid := syscall.Getpid() + if !pidRunning(pid) { + t.Errorf("pid %v is not running", pid) + } + + if pidRunning(invalidPid) { + t.Errorf("pid %v is running", invalidPid) + } +} -- cgit v1.2.3