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

Unified Diff: pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart

Issue 1120113002: fix file uri suggestions on Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
index 62166fe481f9b2720503e112c7ee5fe38637d824..f186f4e558ffe67b70f133dba386d418e18067e8 100644
--- a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
@@ -6,11 +6,11 @@ library test.services.completion.contributor.dart.importuri;
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/import_uri_contributor.dart';
+import 'package:path/path.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
import 'completion_test_util.dart';
-import 'dart:io';
main() {
groupSep = ' | ';
@@ -58,8 +58,6 @@ class ImportUriContributorTest extends AbstractCompletionTest {
}
test_import_file() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -70,14 +68,13 @@ class ImportUriContributorTest extends AbstractCompletionTest {
expect(request.replacementLength, 0);
assertNotSuggested('completion.dart');
assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
- assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
- assertNotSuggested('foo/bar.dart');
- assertNotSuggested('../blat.dart');
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
}
test_import_file2() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -88,14 +85,13 @@ class ImportUriContributorTest extends AbstractCompletionTest {
expect(request.replacementLength, 2);
assertNotSuggested('completion.dart');
assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
- assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
- assertNotSuggested('foo/bar.dart');
- assertNotSuggested('../blat.dart');
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
}
test_import_file_child() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -107,13 +103,12 @@ class ImportUriContributorTest extends AbstractCompletionTest {
assertNotSuggested('completion.dart');
assertNotSuggested('other.dart');
assertNotSuggested('foo');
- assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
- assertNotSuggested('../blat.dart');
+ assertNotSuggested('foo${separator}');
+ assertSuggest('foo${separator}bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('..${separator}blat.dart');
}
test_import_file_parent() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -125,8 +120,9 @@ class ImportUriContributorTest extends AbstractCompletionTest {
assertNotSuggested('completion.dart');
assertNotSuggested('other.dart');
assertNotSuggested('foo');
- assertNotSuggested('foo/bar.dart');
- assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}');
+ assertNotSuggested('foo${separator}bar.dart');
+ assertSuggest('..${separator}blat.dart', csKind: CompletionSuggestionKind.IMPORT);
}
test_import_package() {
@@ -175,8 +171,6 @@ class ImportUriContributorTest extends AbstractCompletionTest {
}
test_part_file() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -187,14 +181,13 @@ class ImportUriContributorTest extends AbstractCompletionTest {
expect(request.replacementLength, 0);
assertNotSuggested('completion.dart');
assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
- assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
- assertNotSuggested('foo/bar.dart');
- assertNotSuggested('../blat.dart');
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
}
test_part_file2() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -205,14 +198,13 @@ class ImportUriContributorTest extends AbstractCompletionTest {
expect(request.replacementLength, 2);
assertNotSuggested('completion.dart');
assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
- assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
- assertNotSuggested('foo/bar.dart');
- assertNotSuggested('../blat.dart');
+ assertNotSuggested('foo');
+ assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}bar.dart');
+ assertNotSuggested('..${separator}blat.dart');
}
test_part_file_child() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -224,13 +216,12 @@ class ImportUriContributorTest extends AbstractCompletionTest {
assertNotSuggested('completion.dart');
assertNotSuggested('other.dart');
assertNotSuggested('foo');
- assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
- assertNotSuggested('../blat.dart');
+ assertNotSuggested('foo${separator}');
+ assertSuggest('foo${separator}bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('..${separator}blat.dart');
}
test_part_file_parent() {
- // TODO(danrubel) fix file uri discovery on Windows
- if (Platform.isWindows) return;
testFile = '/proj/completion.dart';
addSource('/proj/other.dart', 'library other;');
addSource('/proj/foo/bar.dart', 'library bar;');
@@ -242,7 +233,8 @@ class ImportUriContributorTest extends AbstractCompletionTest {
assertNotSuggested('completion.dart');
assertNotSuggested('other.dart');
assertNotSuggested('foo');
- assertNotSuggested('foo/bar.dart');
- assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+ assertNotSuggested('foo${separator}');
+ assertNotSuggested('foo${separator}bar.dart');
+ assertSuggest('..${separator}blat.dart', csKind: CompletionSuggestionKind.IMPORT);
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698