summaryrefslogtreecommitdiff
path: root/pkg/systray/pid_test.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2019-01-12 18:18:23 +0100
committerRuben Pollan <meskio@sindominio.net>2019-01-15 14:39:21 +0100
commitbea32af5d45702e5608d347bf2bf6314d899f2e0 (patch)
tree3a3b65123a751624a866176d9d59424707474363 /pkg/systray/pid_test.go
parent933ad2aeda754499753e91be05aa9f5556539d35 (diff)
[feat] Reorganize code
Let's use a more structured folder system: https://github.com/golang-standards/project-layout - Resolves: #99
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)
+ }
+}