anchor.diff:    return dir;
   }
   
  -const _personContent = r'''library source_gen.example.person;
  +class _TestGenerator extends Generator {
  +  const _TestGenerator();
   
  -import 'package:source_gen/json_serial/json_annotation.dart';
  +  String generate(Element element) {
  +    return '// Code for $element';
  +  }
   
  -@JsonSerializable()
  +  String toString() => 'TestGenerator';
  +}
  +
  +const _testLibContent = r'''library test_lib;
  +final int foo = 42;
  +
   class Person extends Object with _$PersonSerializerMixin {
     String firstName, middleName, lastName;
     DateTime dob;
  
positive.code:     schedule(() async {
        var filePath = p.join(projectPath, 'lib', 'person.dart');
        var output =
            await generate(getPackagePath(), filePath, [const JsonGenerator()]);
  
        expect(output, isNotNull);
        expect(output, isNotEmpty);
  
negative.code: import 'dart:async';
  import 'dart:io';
  
  import 'package:analyzer/src/generated/element.dart';
  import 'package:path/path.dart' as p;
  import 'package:scheduled_test/descriptor.dart' as d;
  import 'package:scheduled_test/scheduled_test.dart';
  import 'package:source_gen/src/build_file_generator.dart';
  import 'package:source_gen/src/generator.dart';
  
  import 'test_utils.dart';
  
  void main() {
    test('Simple Generator test', () {
      String projectPath;
  
      schedule(() async {
  