toolexit on malformed yaml (#123167)

[flutter_tools] toolexit on malformed yaml during gen-l10n
This commit is contained in:
Christopher Fujino
2023-03-21 19:05:24 -07:00
committed by GitHub
parent 4be45e950d
commit 28d707693b
2 changed files with 22 additions and 1 deletions

View File

@@ -98,4 +98,19 @@ use-deferred-loading: string
throwsException,
);
});
testWithoutContext('parseLocalizationsOptions tool exits on malformed Yaml', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final File configFile = fileSystem.file('l10n.yaml')..writeAsStringSync('''
template-arb-file: {name}_en.arb
''');
expect(
() => parseLocalizationsOptions(
file: configFile,
logger: BufferLogger.test(),
),
throwsToolExit(),
);
});
}