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

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

Issue 15745013: Report parameters/arguments count mismatch (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index 4d60e1bb8fe6090baebb4b67f95d9cf77d047710..fd42e8eec52105dc65f5d32cf44f0b1c3390e9da 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -487,6 +487,18 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ // TODO(scheglov)
jwren 2013/05/22 19:03:16 Did you mean to include the TODO in the CL?
scheglov 2013/05/22 19:37:31 Thank you, removed.
+ public void test_extraPositionalArguments() throws Exception {
+ Source source = addSource(createSource(//
+ "f() {}",
+ "main() {",
+ " f(0, 1, '2');",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS);
+ verify(source);
+ }
+
public void test_fieldInitializerWithInvalidType() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -980,6 +992,18 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ // TODO(scheglov)
+ public void test_notEnoughRequiredArguments() throws Exception {
+ Source source = addSource(createSource(//
+ "f(int a, String b) {}",
+ "main() {",
+ " f();",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS);
+ verify(source);
+ }
+
public void test_partOfDifferentLibrary() throws Exception {
Source source = addSource(createSource(//
"library lib;",
@@ -1143,4 +1167,16 @@ public class StaticWarningCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(StaticWarningCode.UNDEFINED_IDENTIFIER);
}
+
+ // TODO(scheglov)
+ public void test_undefinedNamedParameter() throws Exception {
+ Source source = addSource(createSource(//
+ "f({a, b}) {}",
+ "main() {",
+ " f(c: 1);",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.UNDEFINED_NAMED_PARAMETER);
+ // no verify(), 'c' is not resolved
+ }
}

Powered by Google App Engine
This is Rietveld 408576698