| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:async'; |
| 6 import 'package:async_helper/async_helper.dart'; |
| 7 import 'package:expect/expect.dart'; |
| 8 import 'compiler_helper.dart'; |
| 9 |
| 10 // Test that the compiler doesn't escape too many characters. |
| 11 |
| 12 Future<String> compileExpression(String expression) { |
| 13 var source = "foo() { return $expression; }"; |
| 14 return compile(source, entry: "foo"); |
| 15 } |
| 16 |
| 17 Future runTest() { |
| 18 return compileExpression(r"'Тест на Кирилица - great.\n" |
| 19 r'Next "line".\u2028' |
| 20 r'And another one.\u2029' |
| 21 r"and the last one'") |
| 22 .then((String generated) { |
| 23 Expect.isTrue( |
| 24 generated.contains(r'"Тест на Кирилица - great.\n' |
| 25 r'Next \"line\".\u2028' |
| 26 r'And another one.\u2029' |
| 27 r'and the last one"') || |
| 28 generated.contains(r"'Тест на Кирилица - great.\n" |
| 29 r'Next "line".\u2028' |
| 30 r'And another one.\u2029' |
| 31 r"and the last one'")); |
| 32 }); |
| 33 } |
| 34 |
| 35 main() { |
| 36 asyncTest(runTest); |
| 37 } |
| OLD | NEW |