diff --git a/generator/test/test_util.dart b/generator/test/test_util.dart index 0dc66b6f4..e9c8b7233 100644 --- a/generator/test/test_util.dart +++ b/generator/test/test_util.dart @@ -22,10 +22,12 @@ Future readFileAsDartFormattedString(String path) async { Future 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'); }