You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sig_test.go
    path of file: ./repos/bud/internal/sig
    
    the code of the file until where you have to start completion: package sig_test

import (
	"bufio"
	"context"
	"fmt"
	"io"
	"os"
	"os/exec"
	"syscall"
	"testing"
	"time"

	"github.com/livebud/bud/internal/testsub"

	"github.com/livebud/bud/internal/is"
	"github.com/livebud/bud/internal/sig"
)

func waitFor(r io.Reader, line string) error {
	scanner := bufio.NewScanner(r)
	for scanner.Scan() {
		if scanner.Text() == line {
			return scanner.Err()
		}
		fmt.Print
    
func TestEither(t *testing.T) {
	is := is.New(t)
	parent := func(t testing.TB, cmd *exec.Cmd) {
		stdin, err := cmd.StdinPipe()
		is.NoErr(err)
		stderr, err := cmd.StderrPipe()
		is.NoErr(err)
		cmd.Stdout = os.Stdout
		is.NoErr(cmd.Start())
		is.NoErr(waitFor(stderr, "ready"))
		is.NoErr(cmd.Process.Signal(syscall.SIGQUIT))
		stdin.Write([]byte("interrupt"))
		stdin.Close()
		is.NoErr(cmd.Wait())
	}
	child := func(t testing.TB) {
		ctx := sig.Trap(context.Background(), os.Interrupt, syscall.SIGQUIT)
		// Should not have received signal
		select {
		case <-ctx.Done():
			is.Fail() // context shouldn't be cancelled yet
		default:
		}
		fmt.Fprintln(os.Stderr, "ready")
		waitFor(os.Stdin, "interrupt")
		// Should have received a SIGQUIT
		select {
		case <-ctx.Done():
		case <-time.Tick(time.Second):
			is.Fail() // context should have been cancelled
		}
	}
	testsub.Run(t, parent, child)
}