anchor.diff:          new List.generate(expectedLines, (_) => new Completer<String>());
       lines = completers.map((c) => c.future).toList();
       vm.stdout.transform(UTF8.decoder).transform(splitter).listen((line) {
  -      expect(i, lessThan(expectedLines));
  +      Expect.isTrue(i < expectedLines);
         completers[i++].complete(line);
       }, onDone: () {
  -      expect(i, expectedLines);
  +      Expect.equals(expectedLines, i);
       });
   
       vm.stderr.transform(UTF8.decoder).transform(splitter).toList().then((err) {
  -      expect(err, isEmpty, reason: err.join('\n'));
  +      Expect.isTrue(err.isEmpty, err.join('\n'));
       });
   
       programIsDone = vm.exitCode;
  
positive.code:     var port = await computeVmPort();
      var remoteVm = new RemoteVm(port);
      var reloadResult = await remoteVm.reload(outputUri);
      expect(reloadResult['success'], isTrue);
      await remoteVm.disconnect();
    }
  
    test('initial program is valid', () async {
      await startProgram(0);
      await programIsDone;
      expect(await lines[1], "part1 part2");
    });
  
    test('reload after leaf library modification', () async {
      await startProgram(1);
      expect(await lines[1], "part1 part2");
  
      writeFile(fs, 'b.dart', sourceB.replaceAll("part1", "part3"));
      await rebuild(compiler, outputUri);
      await hotReload();
      await programIsDone;
      expect(await lines[2], "part3 part2");
    });
  
    test('reload after non-leaf library modification', () async {
      await startProgram(1);
      expect(await lines[1], "part1 part2");
  
      writeFile(fs, 'a.dart', sourceA.replaceAll("part2", "part4"));
      await rebuild(compiler, outputUri);
      await hotReload();
      await programIsDone;
      expect(await lines[2], "part1 part4");
    });
  
    test('reload after whole program modification', () async {
      await startProgram(1);
      expect(await lines[1], "part1 part2");
  
      writeFile(fs, 'b.dart', sourceB.replaceAll("part1", "part5"));
      writeFile(fs, 'a.dart', sourceA.replaceAll("part2", "part6"));
      await rebuild(compiler, outputUri);
      await hotReload();
      await programIsDone;
      expect(await lines[2], "part5 part6");
    });
  
    test('reload twice', () async {
      await startProgram(2);
      expect(await lines[1], "part1 part2");
  
      writeFile(fs, 'b.dart', sourceB.replaceAll("part1", "part5"));
      writeFile(fs, 'a.dart', sourceA.replaceAll("part2", "part6"));
      await rebuild(compiler, outputUri);
      await hotReload();
      expect(await lines[2], "part5 part6");
  
      writeFile(fs, 'b.dart', sourceB.replaceAll("part1", "part7"));
      writeFile(fs, 'a.dart', sourceA.replaceAll("part2", "part8"));
      await rebuild(compiler, outputUri);
      await hotReload();
      await programIsDone;
      expect(await lines[3], "part7 part8");
    });
  }
  
  
negative.code:     compiler = createIncrementalCompiler(
          'org-dartlang-test:///a.dart', new HybridFileSystem(fs));
      await rebuild(compiler, outputUri); // this is a full compile.
    }
  
    tearDown() async {
      outDir.deleteSync(recursive: true);
      lines = null;
    }
  
    Future<int> computeVmPort() async {
      var portLine = await lines[0];
      Expect.isTrue(observatoryPortRegExp.hasMatch(portLine));
      var match = observatoryPortRegExp.firstMatch(portLine);
      return int.parse(match.group(1));
    }
  