Index: pkg/js_ast/test/printer_callback_test.dart |
diff --git a/pkg/js_ast/test/printer_callback_test.dart b/pkg/js_ast/test/printer_callback_test.dart |
index b4ff074256cf273ad87d82e8bb522ba705322748..e4bcf835d2f36f4c14cd0771bd27a0a04ee3edc1 100644 |
--- a/pkg/js_ast/test/printer_callback_test.dart |
+++ b/pkg/js_ast/test/printer_callback_test.dart |
@@ -105,11 +105,15 @@ void check(Map<TestMode, String> map) { |
map.forEach((TestMode mode, String expectedOutput) { |
Context context = new Context(mode); |
new Printer(options, context).visit(node); |
- expect(context.getText(), equals(expectedOutput), |
+ expect(context.getText(), |
+ equals(canonicalizeLineEndings(expectedOutput)), |
reason: "Unexpected output for $code in $mode"); |
}); |
} |
+// The string literals may end in \r\n or \n depending on filesystem. |
+canonicalizeLineEndings(String s) => s.replaceAll('\r\n', '\n'); |
+ |
class Context extends SimpleJavaScriptPrintingContext { |
final TestMode mode; |
final Map<Node, int> idMap = {}; |