mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
e731a31eb9
Signed-off-by: leongross <leon.gross@9elements.com>
29 lines
677 B
Go
29 lines
677 B
Go
// Copyright 2024 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 os_test
|
|
|
|
import (
|
|
. "os"
|
|
"testing"
|
|
)
|
|
|
|
func TestFindProcess(t *testing.T) {
|
|
// NOTE: For now, we only test the Linux case since only exec_posix.go is currently the only implementation.
|
|
// Linux guarantees that there is pid 0
|
|
proc, err := FindProcess(0)
|
|
if err != nil {
|
|
t.Error("FindProcess(0): wanted err == nil, got %v:", err)
|
|
}
|
|
|
|
if proc.Pid != 0 {
|
|
t.Error("Expected pid 0, got: ", proc.Pid)
|
|
}
|
|
|
|
pid0 := Process{Pid: 0}
|
|
if *proc != pid0 {
|
|
t.Error("Expected &Process{Pid: 0}, got", *proc)
|
|
}
|
|
}
|