Skip to content

Commit

Permalink
Symbols converted only for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
desistefanova committed Mar 16, 2022
1 parent e25bf0a commit c2028f8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions generator/test/test_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ Future<String> readFileAsDartFormattedString(String path) async {
Future<String> readFileAsErrorFormattedString(String directoryName, String logFileName) async {
var file = File(_path.join(Directory.current.path, 'test/$directoryName/$logFileName'));
String content = await file.readAsString(encoding: utf8);
var macToWinSymbols = {'╷': ',', '━': '=', '╵': '\'', '│': '|'};
macToWinSymbols.forEach((key, value) {
content = Platform.isWindows ? content.replaceAll(key, value) : content.replaceAll(value, key);
});
if (Platform.isWindows) {
var macToWinSymbols = {'╷': ',', '━': '=', '╵': '\'', '│': '|'};
macToWinSymbols.forEach((key, value) {
content = content.replaceAll(key, value);
});
}
return LineSplitter.split(content).join('\n');
}

Expand Down

0 comments on commit c2028f8

Please sign in to comment.