expectFormatTemplateGeneration function

void expectFormatTemplateGeneration(
  1. String content,
  2. TranslationFormat<StringFileData> format,
  3. {List<MainMessage> messages = const []}
)

Compares MainMessages with the template file that would be generated using the indicated format.

Implementation

void expectFormatTemplateGeneration(
  String content,
  TranslationFormat<StringFileData> format, {
  List<MainMessage> messages = const [],
}) {
  final template = MockTemplate(
    'intl',
    Map.fromEntries(messages.map((e) => MapEntry(e.name, e))),
  );
  template.lastModified = null;
  final result = format.generateTemplateFiles(template).first.contents;
  expect(result, content);
}