github.com/dorkamotorka/go/src@v0.0.0-20230614113921-187095f0e316/os/exec_unix_test.go (about)

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build unix
     6  
     7  package os_test
     8  
     9  import (
    10  	"internal/testenv"
    11  	. "os"
    12  	"testing"
    13  )
    14  
    15  func TestErrProcessDone(t *testing.T) {
    16  	testenv.MustHaveGoBuild(t)
    17  	t.Parallel()
    18  
    19  	p, err := StartProcess(testenv.GoToolPath(t), []string{"go"}, &ProcAttr{})
    20  	if err != nil {
    21  		t.Errorf("starting test process: %v", err)
    22  	}
    23  	p.Wait()
    24  	if got := p.Signal(Kill); got != ErrProcessDone {
    25  		t.Errorf("got %v want %v", got, ErrProcessDone)
    26  	}
    27  }