anchor.diff:  ''', [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], '''
   part of foo;
   class C { }
  -''', adjustValidUnitBeforeComparison: (CompilationUnit unit) {
  -      unit.beginToken = unit.declarations[0].beginToken;
  -      return unit;
  -    });
  -  }
  -
  -  @failingTest
  +''', adjustValidUnitBeforeComparison: _updateBeginToken);
  +  }
  +
     void test_exportBeforeLibrary() {
  -    // TODO(danrubel): members are not reordered
       testRecovery('''
   export 'bar.dart';
   library l;
   ''', [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], '''
   library l;
   export 'bar.dart';
  -''');
  -  }
  -
  -  @failingTest
  +''', adjustValidUnitBeforeComparison: _moveFirstDirectiveToEnd);
  +  }
  +
     void test_importBeforeLibrary() {
  -    // TODO(danrubel): members are not reordered
       testRecovery('''
   import 'bar.dart';
   library l;
   ''', [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], '''
   library l;
   import 'bar.dart';
  -''');
  -  }
  -
  -  @failingTest
  +''', adjustValidUnitBeforeComparison: _moveFirstDirectiveToEnd);
  +  }
  +
     void test_partBeforeExport() {
  -    // TODO(danrubel): members are not reordered
       testRecovery('''
   part 'foo.dart';
   export 'bar.dart';
   ''', [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE], '''
   export 'bar.dart';
   part 'foo.dart';
  -''');
  -  }
  -
  -  @failingTest
  +''', adjustValidUnitBeforeComparison: _moveFirstDirectiveToEnd);
  +  }
  +
     void test_partBeforeImport() {
  -    // TODO(danrubel): members are not reordered
       testRecovery('''
   part 'foo.dart';
   import 'bar.dart';
   ''', [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE], '''
   import 'bar.dart';
   part 'foo.dart';
  -''');
  -  }
  -
  -  @failingTest
  +''', adjustValidUnitBeforeComparison: _moveFirstDirectiveToEnd);
  +  }
  +
     void test_partBeforeLibrary() {
  -    // TODO(danrubel): members are not reordered
       testRecovery('''
   part 'foo.dart';
   library l;
   ''', [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], '''
   library l;
   part 'foo.dart';
  -''');
  +''', adjustValidUnitBeforeComparison: _moveFirstDirectiveToEnd);
  +  }
  +
  +  CompilationUnit _moveFirstDirectiveToEnd(CompilationUnit unit) {
  +    unit.directives.add(unit.directives.removeAt(0));
  +    unit.beginToken = unit.directives[0].beginToken;
  +    return unit;
  +  }
  +
  +  CompilationUnit _updateBeginToken(CompilationUnit unit) {
  +    unit.beginToken = unit.declarations[0].beginToken;
  +    return unit;
     }
   }
   
  
positive.code: ''', [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], '''
  export 'bar.dart';
  class C { }
  ''', adjustValidUnitBeforeComparison: (CompilationUnit unit) {
        unit.beginToken = unit.declarations[0].beginToken;
        return unit;
      });
    }
  
    void test_declarationBeforeDirective_import() {
  
negative.code: ''', [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], '''
  import 'bar.dart';
  class C { }
  ''', adjustValidUnitBeforeComparison: _updateBeginToken);
    }
  
    void test_declarationBeforeDirective_part() {
  