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

Side by Side Diff: tests/try/poi/poi_find_test.dart

Issue 927563002: Fix hidden try tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « tests/try/poi/library_updater_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 /// Test that poi.dart finds the right element. 5 /// Test that poi.dart finds the right element.
6 6
7 library trydart.poi_find_test; 7 library trydart.poi_find_test;
8 8
9 import 'dart:io' show 9 import 'dart:io' show
10 Platform; 10 Platform;
(...skipping 17 matching lines...) Expand all
28 Uri script = Platform.script.resolve('data/empty_main.dart'); 28 Uri script = Platform.script.resolve('data/empty_main.dart');
29 FormattingDiagnosticHandler handler = new FormattingDiagnosticHandler(); 29 FormattingDiagnosticHandler handler = new FormattingDiagnosticHandler();
30 handler.verbose = false; 30 handler.verbose = false;
31 31
32 Future future = poi.runPoi(script, 225, handler.provider, handler); 32 Future future = poi.runPoi(script, 225, handler.provider, handler);
33 return future.then((Element element) { 33 return future.then((Element element) {
34 Uri foundScript = element.compilationUnit.script.resourceUri; 34 Uri foundScript = element.compilationUnit.script.resourceUri;
35 Expect.stringEquals('$script', '$foundScript'); 35 Expect.stringEquals('$script', '$foundScript');
36 Expect.stringEquals('main', element.name); 36 Expect.stringEquals('main', element.name);
37 37
38 String source = handler.provider.sourceFiles['$script'].slowText(); 38 String source = handler.provider.sourceFiles[script].slowText();
39 final int position = source.indexOf('main()'); 39 final int position = source.indexOf('main()');
40 Expect.isTrue(position > 0, '$position > 0'); 40 Expect.isTrue(position > 0, '$position > 0');
41 41
42 var token; 42 var token;
43 43
44 // When the cursor is at the same character offset as "main()", it 44 // When the cursor is at the same character offset as "main()", it
45 // corresponds to having the cursor just before "main()". So we find the 45 // corresponds to having the cursor just before "main()". So we find the
46 // "void" token. 46 // "void" token.
47 token = poi.findToken(element, position); 47 token = poi.findToken(element, position);
48 Expect.isNotNull(token, 'token'); 48 Expect.isNotNull(token, 'token');
(...skipping 18 matching lines...) Expand all
67 token = poi.findToken(element, position + 5); 67 token = poi.findToken(element, position + 5);
68 Expect.isNotNull(token, 'token'); 68 Expect.isNotNull(token, 'token');
69 Expect.equals(position + 4, token.charOffset, '$token'); 69 Expect.equals(position + 4, token.charOffset, '$token');
70 Expect.stringEquals('(', token.value); 70 Expect.stringEquals('(', token.value);
71 }); 71 });
72 } 72 }
73 73
74 void main() { 74 void main() {
75 asyncTest(testPoi); 75 asyncTest(testPoi);
76 } 76 }
OLDNEW
« no previous file with comments | « tests/try/poi/library_updater_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698