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); |
} |
} |