Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: dart/tests/try/paste_content_rewriting_test.dart

Issue 373563002: Handle multiline interpolated strings in line-based scanner. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: getDecoration has side effects Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/tests/language/string_interpolation_newline_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library trydart.paste_test; 5 library trydart.paste_test;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import 'package:try/src/interaction_manager.dart' show 10 import 'package:try/src/interaction_manager.dart' show
(...skipping 13 matching lines...) Expand all
24 '<span><p>//...</p>}</span>': '//...\n}', 24 '<span><p>//...</p>}</span>': '//...\n}',
25 'someText': 'someText', 25 'someText': 'someText',
26 '"\$"': '"<DIAGNOSTIC>\$</DIAGNOSTIC>"', 26 '"\$"': '"<DIAGNOSTIC>\$</DIAGNOSTIC>"',
27 '"\$\$"': '"<DIAGNOSTIC>\$</DIAGNOSTIC><DIAGNOSTIC>\$</DIAGNOSTIC>"', 27 '"\$\$"': '"<DIAGNOSTIC>\$</DIAGNOSTIC><DIAGNOSTIC>\$</DIAGNOSTIC>"',
28 '"\$\$4"': '"<DIAGNOSTIC>\$</DIAGNOSTIC><DIAGNOSTIC>\$</DIAGNOSTIC>4"', 28 '"\$\$4"': '"<DIAGNOSTIC>\$</DIAGNOSTIC><DIAGNOSTIC>\$</DIAGNOSTIC>4"',
29 '"\$\$4 "': '"<DIAGNOSTIC>\$</DIAGNOSTIC><DIAGNOSTIC>\$</DIAGNOSTIC>4 "', 29 '"\$\$4 "': '"<DIAGNOSTIC>\$</DIAGNOSTIC><DIAGNOSTIC>\$</DIAGNOSTIC>4 "',
30 '1e': '<DIAGNOSTIC>1e</DIAGNOSTIC>', 30 '1e': '<DIAGNOSTIC>1e</DIAGNOSTIC>',
31 'r"""\n\n\'"""': 'r"""\n\n\'"""', 31 'r"""\n\n\'"""': 'r"""\n\n\'"""',
32 '"': '<DIAGNOSTIC>"</DIAGNOSTIC>', 32 '"': '<DIAGNOSTIC>"</DIAGNOSTIC>',
33 '/**\n*/': '/**\n*/', 33 '/**\n*/': '/**\n*/',
34
35 // The following case tests that single line strings can span multiple lines
36 // via ${}. The string is constructed so that it is possible to tell if the
37 // line-bases scanner (incorrectly) reverses the order of the string quotes
38 // in its state string. The example string is a complicated way of writing:
39 // '[[{{}: {}}]]'. See also
40 // tests/language/string_interpolation_newline_test.dart.
41 '"\${ [ "\${ [ \'\${ { \'\${\n{\n} }\' : {\n} } }\' ] }" ] }"':
42 '"\${ [ "\${ [ \'\${ { \'\${\n{\n} }\' : {\n} } }\' ] }" ] }"',
34 }; 43 };
35 44
36 List<Node> queryDiagnosticNodes() { 45 List<Node> queryDiagnosticNodes() {
37 return mainEditorPane.querySelectorAll('a.diagnostic>span'); 46 return mainEditorPane.querySelectorAll('a.diagnostic>span');
38 } 47 }
39 48
40 Future runTests() { 49 Future runTests() {
41 Iterator<String> keys = tests.keys.iterator; 50 Iterator<String> keys = tests.keys.iterator;
42 keys.moveNext(); 51 keys.moveNext();
43 mainEditorPane.innerHtml = keys.current; 52 mainEditorPane.innerHtml = keys.current;
(...skipping 27 matching lines...) Expand all
71 80
72 var interaction = new InteractionManager(); 81 var interaction = new InteractionManager();
73 mainEditorPane = new DivElement(); 82 mainEditorPane = new DivElement();
74 document.body.append(mainEditorPane); 83 document.body.append(mainEditorPane);
75 observer = new MutationObserver(interaction.onMutation) 84 observer = new MutationObserver(interaction.onMutation)
76 ..observe( 85 ..observe(
77 mainEditorPane, childList: true, characterData: true, subtree: true); 86 mainEditorPane, childList: true, characterData: true, subtree: true);
78 87
79 asyncTest(runTests); 88 asyncTest(runTests);
80 } 89 }
OLDNEW
« no previous file with comments | « dart/tests/language/string_interpolation_newline_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698