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

Unified Diff: tests/language/positional_parameters_type_test.dart

Issue 21832003: Fix VM implementation of CastError not to extend TypeError (issue 5280). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/positional_parameters_type_test.dart
===================================================================
--- tests/language/positional_parameters_type_test.dart (revision 25753)
+++ tests/language/positional_parameters_type_test.dart (working copy)
@@ -23,17 +23,25 @@
acceptFunNumOptBool(funNumOptBool); // No error.
try {
acceptFunNumOptBool(funNum); // No static type warning.
- } on TypeError catch (error) {
+ } on TypeError catch (error, stacktrace) {
result += 1;
- Expect.stringEquals("(num, [bool]) => void", error.dstType);
- Expect.stringEquals("(num) => void", error.srcType);
+ var msg = error.toString();
+ Expect.isTrue(msg.contains("'(num, [bool]) => void'")); // dstType
+ Expect.isTrue(msg.contains("'(num) => void'")); // srcType
+ Expect.isTrue(msg.contains("'funNumOptBool'")); // dstName
+ Expect.isTrue(stacktrace.toString().
+ contains("positional_parameters_type_test.dart:14:35"));
}
try {
acceptFunNumOptBool(funNumBool); /// static type warning
- } on TypeError catch (error) {
+ } on TypeError catch (error, stacktrace) {
result += 10;
- Expect.stringEquals("(num, [bool]) => void", error.dstType);
- Expect.stringEquals("(num, bool) => void", error.srcType);
+ var msg = error.toString();
+ Expect.isTrue(msg.contains("'(num, [bool]) => void'")); // dstType
+ Expect.isTrue(msg.contains("'(num, bool) => void'")); // srcType
+ Expect.isTrue(msg.contains("'funNumOptBool'")); // dstName
+ Expect.isTrue(stacktrace.toString().
+ contains("positional_parameters_type_test.dart:14:35"));
}
try {
acceptFunNumOptBool(funNumOptBoolX); // No static type warning.

Powered by Google App Engine
This is Rietveld 408576698