summaryrefslogtreecommitdiff
path: root/pkg/systray/pid_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/systray/pid_test.go')
-rw-r--r--pkg/systray/pid_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/systray/pid_test.go b/pkg/systray/pid_test.go
new file mode 100644
index 0000000..dda8384
--- /dev/null
+++ b/pkg/systray/pid_test.go
@@ -0,0 +1,21 @@
+package systray
+
+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)
+ }
+}