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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/PubSuggestionCodeTest.java

Issue 15736020: generate suggestions during analysis (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 7 years, 7 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/PubSuggestionCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/PubSuggestionCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/PubSuggestionCodeTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..4fb468f9832b54482c34ef8a3b9fde2e91c2d66e
--- /dev/null
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/PubSuggestionCodeTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013, the Dart project authors.
+ *
+ * Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.dart.engine.resolver;
+
+import com.google.dart.engine.error.CompileTimeErrorCode;
+import com.google.dart.engine.error.PubSuggestionCode;
+import com.google.dart.engine.source.Source;
+
+public class PubSuggestionCodeTest extends ResolverTestCase {
+
+ public void test_import_packageWithDotDot() throws Exception {
+ Source source = addSource(createSource(//
+ "import 'package:somepackage/../other.dart';"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+ PubSuggestionCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT);
+ }
+
+ public void test_import_referenceIntoLibDirectory() throws Exception {
+ Source source = addSource(createSource(//
+ "import '../lib/other.dart';"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+ PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE);
+ }
+
+ public void test_import_referenceOutOfLibDirectory() throws Exception {
+ Source source = addSource("lib/test.dart", createSource(//
+ "import '../web/other.dart';"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+ PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE);
+ }
+
+ public void test_import_valid() throws Exception {
+ Source source = addSource("lib2/test.dart", createSource(//
+ "import '../web/other.dart';"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.URI_DOES_NOT_EXIST);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698