summaryrefslogtreecommitdiff
path: root/pid_test.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-06-21 11:13:53 +0200
committerRuben Pollan <meskio@sindominio.net>2018-06-21 13:27:05 +0200
commita858e94f602ca0824951d4baff441cd13c594e9e (patch)
tree70209dc1874a57eec97726e6926bc2ed69ed88cd /pid_test.go
parent199ef6f9be94a08580cd6bdbf5d54518e11217c1 (diff)
[bug] add windows support to the pid file
- Resolves: #43
Diffstat (limited to 'pid_test.go')
-rw-r--r--pid_test.go21
1 files changed, 21 insertions, 0 deletions
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)
+ }
+}