anchor.diff:    @override
     void serializeLibraryText(String text, {bool allowErrors: false}) {
       Source source = addSource(text);
  +    _fileContents[source] = text;
       LibraryElement library = resolve2(source);
       if (!allowErrors) {
         assertNoErrors(source);
  
positive.code:   void verifyPublicNamespace() {
      for (int i = 0; i < unlinkedUnits.length; i++) {
        Source source = analysisContext.sourceFactory.forUri(unitUris[i]);
        String text = analysisContext.getContents(source).data;
        UnlinkedPublicNamespace namespace =
            computePublicNamespaceFromText(text, source);
        expect(canonicalize(namespace),
            canonicalize(unlinkedUnits[i].publicNamespace),
            reason: 'publicNamespace(${unitUris[i]})');
      }
    }
  }
  
negative.code:     expect(unlinkedUnits[0].libraryNameLength, 0);
    }
  
    test_library_with_missing_part() {
      // References to other parts should still be resolved.
      allowMissingFiles = true;
      addNamedSource('/bar.dart', 'part of my.lib; class C {}');
      serializeLibraryText(
          'library my.lib; part "foo.dart"; part "bar.dart"; C c;',
          allowErrors: true);
      checkTypeRef(findVariable('c').type, null, null, 'C',
          expectedTargetUnit: 2);
    }
  
    test_local_names_take_precedence_over_imported_names() {
      addNamedSource('/a.dart', 'class C {} class D {}');
      serializeLibraryText('''
  