Chromium Code Reviews| Index: tests/compiler/dart2js/string_escapes2_test.dart |
| diff --git a/tests/compiler/dart2js/string_escapes2_test.dart b/tests/compiler/dart2js/string_escapes2_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..17d717aa4f1648b02a888df82e62d9ba063939bb |
| --- /dev/null |
| +++ b/tests/compiler/dart2js/string_escapes2_test.dart |
| @@ -0,0 +1,28 @@ |
| +// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import 'dart:async'; |
| +import 'package:async_helper/async_helper.dart'; |
| +import 'package:expect/expect.dart'; |
| +import 'compiler_helper.dart'; |
| + |
| +// Test that the compiler doesn't escape too many characters. |
| + |
| +Future<String> compileExpression(String expression) { |
| + var source = "foo() { return $expression; }"; |
| + return compile(source, entry: "foo"); |
| +} |
| + |
| +Future runTest() { |
| + return compileExpression("'Тест на Кирилица - great.\\nNext \"line\".'") |
|
sra1
2015/02/17 20:03:53
Add $PS and $LS.
floitsch
2015/02/20 13:55:50
Done.
|
| + .then((String generated) { |
| + Expect.isTrue( |
| + generated.contains(r'"Тест на Кирилица - great.\nNext \"line\"."') || |
|
Johnni Winther
2015/02/17 14:19:46
Shouldn't it be '\\nNext' instead of '\nNext' ?
floitsch
2015/02/20 13:55:50
No. This string is a raw string.
|
| + generated.contains("'Тест на Кирилица - great.\\nNext \"line\".'")); |
| + }); |
| +} |
| + |
| +main() { |
| + asyncTest(runTest); |
| +} |