Skip to content

Commit

Permalink
Normalize with DartFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Aug 12, 2022
1 parent b5a39a7 commit ba2de2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion generator/test/test_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ class LinesEqualsMatcher extends Matcher {

Future<Map<String, Object>> getExpectedFileAsset(String inputFilePath, String expectedFilePath) async {
var key = 'pkg|${_path.setExtension(inputFilePath, '.realm_objects.g.part')}';
return {key: GoldenFileMatcher(File(expectedFilePath), (f) => MyersDiffMatcher(f.readAsStringSync()))};
return {
key: GoldenFileMatcher(
File(expectedFilePath),
(f) => MyersDiffMatcher(DartFormatter(lineEnding: '\n').format(f.readAsStringSync())),
)
};
}

Future<String> readFileAsDartFormattedString(String path) async {
Expand Down

0 comments on commit ba2de2f

Please sign in to comment.