anchor.diff:    }
   ''');
         });
  -
  -      test('correctly generates simple message with multiple dates', () {
  -        const String singleDateMessageArbFileString = '''{
  -  "springRange": "Spring begins on {springStartDate} and ends on {springEndDate}",
  -  "@springRange": {
  -      "description": "The range of dates for spring in the year",
  -      "placeholders": {
  -          "springStartDate": {
  -              "type": "DateTime",
  -              "format": "yMMMMEEEEd"
  -          },
  -          "springEndDate": {
  -              "type": "DateTime",
  -              "format": "yMMMMEEEEd"
  -          }
  -      }
  -  }
  -}''';
  -        final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
  -          ..createSync(recursive: true);
  -        l10nDirectory.childFile(defaultTemplateArbFileName)
  -          .writeAsStringSync(singleDateMessageArbFileString);
  -
  -        final LocalizationsGenerator generator = LocalizationsGenerator(fs);
  -        try {
  -          generator.initialize(
  -            l10nDirectoryPath: defaultArbPathString,
  -            templateArbFileName: defaultTemplateArbFileName,
  -            outputFileString: defaultOutputFileString,
  -            classNameString: defaultClassNameString,
  -          );
  -          generator.parseArbFiles();
  -          generator.generateClassMethods();
  -        } on Exception catch (e) {
  -          fail('Parsing template arb file should succeed: \n$e');
  -        }
  -
  -        expect(generator.classMethods, isNotEmpty);
  -        expect(
  -          generator.classMethods.first,
  -          '''
  -  String springRange(DateTime springStartDate, DateTime springEndDate) {
  -    final DateFormat springStartDateDateFormat = DateFormat.yMMMMEEEEd(_localeName);
  -    final String springStartDateString = springStartDateDateFormat.format(springStartDate);
  -
  -    final DateFormat springEndDateDateFormat = DateFormat.yMMMMEEEEd(_localeName);
  -    final String springEndDateString = springEndDateDateFormat.format(springEndDate);
  -
  -    String springRange(Object springStartDate, Object springEndDate) {
  -      return Intl.message(
  -        'Spring begins on \${springStartDate} and ends on \${springEndDate}',
  -        locale: _localeName,
  -        name: 'springRange',
  -        desc: 'The range of dates for spring in the year',
  -        args: <Object>[springStartDate, springEndDate]
  -      );
  -    }
  -    return springRange(springStartDateString, springEndDateString);
  -  }
  -''');
  -      });
  -
  -      test('correctly generates a plural message with DateTime placeholders', () {
  -        const String pluralMessageWithDateTimePlaceholder = '''{
  -    "helloWorlds": "{count,plural, =1{Hello World, today is {currentDate}}=2{Hello two worlds, today is {currentDate}}many{Hello all {count} worlds, today is {currentDate}}other{Hello other {count} worlds, today is {currentDate}}}",
  -  "@helloWorlds": {
  -    "placeholders": {
  -      "count": {},
  -      "currentDate": {
  -        "type": "DateTime",
  -        "format": "yMMMMEEEEd"
  -      }
  -    }
  -  }
  -}''';
  -        final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
  -          ..createSync(recursive: true);
  -        l10nDirectory.childFile(defaultTemplateArbFileName)
  -          .writeAsStringSync(pluralMessageWithDateTimePlaceholder);
  -
  -        final LocalizationsGenerator generator = LocalizationsGenerator(fs);
  -        try {
  -          generator.initialize(
  -            l10nDirectoryPath: defaultArbPathString,
  -            templateArbFileName: defaultTemplateArbFileName,
  -            outputFileString: defaultOutputFileString,
  -            classNameString: defaultClassNameString,
  -          );
  -          generator.parseArbFiles();
  -          generator.generateClassMethods();
  -        } on Exception catch (e) {
  -          fail('Parsing template arb file should succeed: \n$e');
  -        }
  -
  -        expect(generator.classMethods, isNotEmpty);
  -        expect(
  -          generator.classMethods.first,
  -          r'''
  -  String helloWorlds(int count, DateTime currentDate) {
  -    final DateFormat currentDateDateFormat = DateFormat.yMMMMEEEEd(_localeName);
  -    final String currentDateString = currentDateDateFormat.format(currentDate);
  -
  -    String helloWorlds(int count, Object currentDate) {
  -      return Intl.plural(
  -        count,
  -      locale: _localeName,
  -      name: 'helloWorlds',
  -      args: <Object>[count, currentDate],
  -      one: 'Hello World, today is ${currentDateString}',
  -      two: 'Hello two worlds, today is ${currentDateString}',
  -      many: 'Hello all ${count} worlds, today is ${currentDateString}',
  -      other: 'Hello other ${count} worlds, today is ${currentDateString}'
  -      );
  -    }
  -    return helloWorlds(count, currentDateString);
  -  }
  -''');
       });
   
       group('Number tests', () {
  -      test('correctly generates simple message with numbers', () {
  -        const String singleNumberMessage = '''{
  -  "courseCompletion": "You have completed {progress} of the course.",
  -  "@courseCompletion": {
  -    "description": "The amount of progress the student has made in their class.",
  -    "placeholders": {
  -      "progress": {
  -        "type": "double",
  -        "format": "compact"
  -      }
  -    }
  -  }
  -}''';
  -        final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
  -          ..createSync(recursive: true);
  -        l10nDirectory.childFile(defaultTemplateArbFileName)
  -          .writeAsStringSync(singleNumberMessage);
  -
  -        final LocalizationsGenerator generator = LocalizationsGenerator(fs);
  -        try {
  -          generator.initialize(
  -            l10nDirectoryPath: defaultArbPathString,
  -            templateArbFileName: defaultTemplateArbFileName,
  -            outputFileString: defaultOutputFileString,
  -            classNameString: defaultClassNameString,
  -          );
  -          generator.parseArbFiles();
  -          generator.generateClassMethods();
  -        } on Exception catch (e) {
  -          fail('Parsing template arb file should succeed: \n$e');
  -        }
  -
  -        expect(generator.classMethods, isNotEmpty);
  -        expect(
  -          generator.classMethods.first,
  -          r'''
  -  String courseCompletion(double progress) {
  -    final NumberFormat progressNumberFormat = NumberFormat.compact(
  -      locale: _localeName,
  -    );
  -    final String progressString = progressNumberFormat.format(progress);
  -
  -    String courseCompletion(Object progress) {
  -      return Intl.message(
  -        'You have completed ${progress} of the course.',
  -        locale: _localeName,
  -        name: 'courseCompletion',
  -        desc: 'The amount of progress the student has made in their class.',
  -        args: <Object>[progress]
  -      );
  -    }
  -    return courseCompletion(progressString);
  -  }
  -''');
  -      });
  -
         test('correctly adds optional named parameters to numbers', () {
           const Set<String> numberFormatsWithNamedParameters = <String>{
             'compact',
  
positive.code:     });
  
      group('plural messages', () {
        test('correctly generates a plural message', () {
          const String singlePluralMessageArbFileString = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello World}=2{Hello two worlds}few{Hello {count} worlds}many{Hello all {count} worlds}other{Hello other {count} worlds}}",
    "@helloWorlds": {
      "placeholders": {
        "count": {}
      }
    }
  }''';
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(singlePluralMessageArbFileString);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on Exception catch (e) {
            fail('Parsing template arb file should succeed: \n$e');
          }
  
          expect(generator.classMethods, isNotEmpty);
          expect(
            generator.classMethods.first,
            r'''
    String helloWorlds(int count) {
      return Intl.plural(
        count,
        locale: _localeName,
        name: 'helloWorlds',
        args: <Object>[count],
        zero: 'Hello',
        one: 'Hello World',
        two: 'Hello two worlds',
        few: 'Hello ${count} worlds',
        many: 'Hello all ${count} worlds',
        other: 'Hello other ${count} worlds'
      );
    }
  '''
          );
        });
  
        test('correctly generates a plural message with placeholders', () {
          const String pluralMessageWithMultiplePlaceholders = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello {adjective} World}=2{Hello two {adjective} worlds}few{Hello {count} {adjective} worlds}many{Hello all {count} {adjective} worlds}other{Hello other {count} {adjective} worlds}}",
    "@helloWorlds": {
      "placeholders": {
        "count": {},
        "adjective": {}
      }
    }
  }''';
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithMultiplePlaceholders);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on Exception catch (e) {
            fail('Parsing template arb file should succeed: \n$e');
          }
  
          expect(generator.classMethods, isNotEmpty);
          expect(
            generator.classMethods.first,
            r'''
    String helloWorlds(int count, Object adjective) {
      return Intl.plural(
        count,
        locale: _localeName,
        name: 'helloWorlds',
        args: <Object>[count, adjective],
        zero: 'Hello',
        one: 'Hello ${adjective} World',
        two: 'Hello two ${adjective} worlds',
        few: 'Hello ${count} ${adjective} worlds',
        many: 'Hello all ${count} ${adjective} worlds',
        other: 'Hello other ${count} ${adjective} worlds'
      );
    }
  '''
          );
        });
  
        test('correctly generates a plural message with DateTime placeholders', () {
          const String pluralMessageWithDateTimePlaceholder = '''{
    "helloWorlds": "{count,plural, =1{Hello World, today is {currentDate}}=2{Hello two worlds, today is {currentDate}}many{Hello all {count} worlds, today is {currentDate}}other{Hello other {count} worlds, today is {currentDate}}}",
    "@helloWorlds": {
      "placeholders": {
        "count": {},
        "currentDate": {
          "type": "DateTime",
          "format": "yMMMMEEEEd"
        }
      }
    }
  }''';
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithDateTimePlaceholder);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on Exception catch (e) {
            fail('Parsing template arb file should succeed: \n$e');
          }
  
          expect(generator.classMethods, isNotEmpty);
          expect(
            generator.classMethods.first,
            r'''
    String helloWorlds(int count, DateTime currentDate) {
      final DateFormat currentDateDateFormat = DateFormat.yMMMMEEEEd(_localeName);
      final String currentDateString = currentDateDateFormat.format(currentDate);
  
      String helloWorlds(int count, Object currentDate) {
        return Intl.plural(
          count,
        locale: _localeName,
        name: 'helloWorlds',
        args: <Object>[count, currentDate],
        one: 'Hello World, today is ${currentDateString}',
        two: 'Hello two worlds, today is ${currentDateString}',
        many: 'Hello all ${count} worlds, today is ${currentDateString}',
        other: 'Hello other ${count} worlds, today is ${currentDateString}'
        );
      }
      return helloWorlds(count, currentDateString);
    }
  '''
          );
        });
  
        test('correctly generates a plural message with number placeholders', () {
          const String pluralMessageWithDateTimePlaceholder = '''{
    "helloWorlds": "{count,plural, =1{Hello World of {population} citizens}=2{Hello two worlds with {population} total citizens}many{Hello all {count} worlds, with a total of {population} citizens}other{Hello other {count} worlds, with a total of {population} citizens}}",
    "@helloWorlds": {
      "placeholders": {
        "count": {},
        "population": {
          "type": "int",
          "format": "compactLong"
        }
      }
    }
  }''';
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithDateTimePlaceholder);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on Exception catch (e) {
            fail('Parsing template arb file should succeed: \n$e');
          }
  
          expect(generator.classMethods, isNotEmpty);
          expect(
            generator.classMethods.first,
            r'''
    String helloWorlds(int count, int population) {
      final NumberFormat populationNumberFormat = NumberFormat.compactLong(
        locale: _localeName,
      );
      final String populationString = populationNumberFormat.format(population);
  
      String helloWorlds(int count, Object population) {
        return Intl.plural(
          count,
        locale: _localeName,
        name: 'helloWorlds',
        args: <Object>[count, population],
        one: 'Hello World of ${populationString} citizens',
        two: 'Hello two worlds with ${populationString} total citizens',
        many: 'Hello all ${count} worlds, with a total of ${populationString} citizens',
        other: 'Hello other ${count} worlds, with a total of ${populationString} citizens'
        );
      }
      return helloWorlds(count, populationString);
    }
  '''
          );
        });
  
      test('should throw attempting to generate a plural message without placeholders', () {
        const String pluralMessageWithoutPlaceholdersAttribute = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello World}=2{Hello two worlds}few{Hello {count} worlds}many{Hello all {count} worlds}other{Hello other {count} worlds}}",
    "@helloWorlds": {
      "description": "Improperly formatted since it has no placeholder attribute."
  
negative.code:   });
  
    group('generateClassMethods', () {
      group('DateTime tests', () {
        test('throws an exception when improperly formatted date is passed in', () {
          const String singleDateMessageArbFileString = '''{
    "springBegins": "Spring begins on {springStartDate}",
  