Skip to content

Commit

Permalink
test: tweak golden test
Browse files Browse the repository at this point in the history
  • Loading branch information
halildurmus committed Jan 16, 2025
1 parent 84d6d5f commit 066471f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/generator/test/goldens_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ void main() {
void compareGolden(String fileName, String content) {
File('test/goldens/$fileName.comparison').writeAsStringSync(content);
final golden = File('test/goldens/$fileName.golden').readAsStringSync();
expect(content, equals(golden.convertLineEndingsToLF()));
expect(content, equals(golden));
}

extension on String {
String convertLineEndingsToLF() => replaceAll('\r\n', '\n');

/// Formats this string.
String format() =>
DartFormatter(languageVersion: DartFormatter.latestLanguageVersion)
Expand Down

0 comments on commit 066471f

Please sign in to comment.