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