Commit 097562e2 authored by Boris Mühmer's avatar Boris Mühmer
Browse files

changed name

parent b354c1c2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -64,14 +64,14 @@ func New() (*Expect, error) {
	return x, nil
}

func asyncBool(c chan<- bool, b bool) {
func asyncSendBool(c chan<- bool, b bool) {
	go func() {
		c <- b
	}()
}

func (x *Expect) Close() error {
	asyncBool(x.terminateStream, true)
	asyncSendBool(x.terminateStream, true)
	<-x.finishedStream
	return nil
}
@@ -181,8 +181,8 @@ func (x *Expect) worker(started chan<- bool) {
			case !valid || !terminate:
				continue
			default:
				asyncBool(terminateOutStream, true)
				asyncBool(terminateErrStream, true)
				asyncSendBool(terminateOutStream, true)
				asyncSendBool(terminateErrStream, true)
			}
		case terminated, valid := <-terminatedOutStream:
			switch {
@@ -190,7 +190,7 @@ func (x *Expect) worker(started chan<- bool) {
				continue
			default:
				terminatedOut = true
				asyncBool(checkStream, true)
				asyncSendBool(checkStream, true)
			}
		case terminated, valid := <-terminatedErrStream:
			switch {
@@ -198,7 +198,7 @@ func (x *Expect) worker(started chan<- bool) {
				continue
			default:
				terminatedErr = true
				asyncBool(checkStream, true)
				asyncSendBool(checkStream, true)
			}
		case check, valid := <-checkStream:
			switch {
@@ -220,7 +220,7 @@ func process(
	terminateStream <-chan bool,
	terminatedStream chan<- bool,
) {
	defer asyncBool(terminatedStream, true)
	defer asyncSendBool(terminatedStream, true)
	matches := []PatternValue{}

	startedStream <- true