anchor.diff:        var killedPrematurely = false;
         if (!_exitCode.hasValue) {
           killedPrematurely = true;
  -        _endExpected = true;
           _process.value.kill(ProcessSignal.SIGKILL);
           // Ensure that the onException queue waits for the process to actually
           // exit after being killed.
  
positive.code: 
    /// Whether the user has scheduled the end of this process by calling either
    /// [shouldExit] or [kill].
    var _endScheduled = false;
  
    /// The task that runs immediately before this process is scheduled to end. If
    /// the process ends during this task, we treat that as expected.
    Task _taskBeforeEnd;
  
    /// Whether the process is expected to terminate at this point.
    var _endExpected = false;
  
    /// Schedules a process to start. [executable], [arguments],
    /// [workingDirectory], and [environment] have the same meaning as for
  
negative.code:       throw new StateError("shouldExit() or kill() already called.");
      }
  
      schedule(() {
        return _exitCode.then((exitCode) {
          if (expectedExitCode != null) {
            expect(exitCode, equals(expectedExitCode));
          }
        });
      }, "waiting for process '$description' to exit");
      _scheduledExitTask = currentSchedule.tasks.contents.last;
    }
  }
  