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

Unified Diff: tests/language/src/NamedParameters4Test.dart

Issue 9270016: Issue 932. Checks for various named arguments cases. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks for comments, changes in tests. Created 8 years, 11 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: tests/language/src/NamedParameters4Test.dart
diff --git a/tests/language/src/NamedParameters10NegativeTest.dart b/tests/language/src/NamedParameters4Test.dart
similarity index 70%
rename from tests/language/src/NamedParameters10NegativeTest.dart
rename to tests/language/src/NamedParameters4Test.dart
index 34f7aac3c86f4d6889a10f31bec320db8168a44f..4640d04cc404e66c239b054c7a67db6e5bc4b7b6 100644
--- a/tests/language/src/NamedParameters10NegativeTest.dart
+++ b/tests/language/src/NamedParameters4Test.dart
@@ -2,8 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing named parameters.
+// Specifying named argument for not existing named parameter is run time error.
-// This test is very similar to NamedParameters3NegativeTest, but exersizes a
+// This test is very similar to NamedParameters3Test, but exersizes a
// different corner case in the frog compiler. frog wasn't detecting unused
// named arguments when no other arguments were expected. So, this test
// purposely passes the exact number of positional parameters
@@ -13,10 +14,11 @@ int test(int a) {
}
main() {
+ bool foundError = false;
try {
test(10, x:99); // 1 positional arg, as expected. Param x does not exist.
- } catch (var e) {
- // This is a negative test that should not compile.
- // If it runs due to a bug, catch and ignore exceptions.
+ } catch (Exception e) {
+ foundError = true;
}
+ Expect.equals(true, foundError);
}

Powered by Google App Engine
This is Rietveld 408576698