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

Unified Diff: tests/language/type_cast_vm_test.dart

Issue 13547002: Make type_cast test less fragile. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_cast_vm_test.dart
===================================================================
--- tests/language/type_cast_vm_test.dart (revision 20869)
+++ tests/language/type_cast_vm_test.dart (working copy)
@@ -22,20 +22,13 @@
int result = 0;
try {
var i = "hello" as int; // Throws a CastError
- } on TypeError catch (error) {
+ } on TypeError catch (error, stacktrace) {
result = 1;
Expect.isTrue(error is CastError);
Expect.equals("int", error.dstType);
Expect.equals("String", error.srcType);
Expect.equals("type cast", error.dstName);
- int pos = error.url.lastIndexOf("/", error.url.length);
- if (pos == -1) {
- pos = error.url.lastIndexOf("\\", error.url.length);
- }
- String subs = error.url.substring(pos + 1, error.url.length);
- Expect.equals("dart:core-patch", subs);
- Expect.equals(1880, error.line);
- Expect.equals(1, error.column);
+ checkTopFunction("type_cast_vm_test.dart:24:23", stacktrace);
}
return result;
}
@@ -64,20 +57,13 @@
}
try {
int i = f("hello" as int); // Throws a CastError
- } on TypeError catch (error) {
+ } on TypeError catch (error, stacktrace) {
result = 1;
Expect.isTrue(error is CastError);
Expect.equals("int", error.dstType);
Expect.equals("String", error.srcType);
Expect.equals("type cast", error.dstName);
- int pos = error.url.lastIndexOf("/", error.url.length);
- if (pos == -1) {
- pos = error.url.lastIndexOf("\\", error.url.length);
- }
- String subs = error.url.substring(pos + 1, error.url.length);
- Expect.equals("dart:core-patch", subs);
- Expect.equals(1880, error.line);
- Expect.equals(1, error.column);
+ checkTopFunction("type_cast_vm_test.dart:59:25", stacktrace);
}
return result;
}
@@ -95,7 +81,7 @@
Expect.equals("int", error.dstType);
Expect.equals("String", error.srcType);
Expect.equals("type cast", error.dstName);
- checkTopFunction("type_cast_vm_test.dart:88:16", stacktrace);
+ checkTopFunction("type_cast_vm_test.dart:74:16", stacktrace);
}
return result;
}
@@ -112,7 +98,7 @@
Expect.equals("int", error.dstType);
Expect.equals("String", error.srcType);
Expect.equals("type cast", error.dstName);
- checkTopFunction("type_cast_vm_test.dart:109:13", stacktrace);
+ checkTopFunction("type_cast_vm_test.dart:95:13", stacktrace);
}
return result;
}
@@ -130,7 +116,7 @@
Expect.equals("int", error.dstType);
Expect.equals("() => dynamic", error.srcType);
Expect.equals("type cast", error.dstName);
- checkTopFunction("type_cast_vm_test.dart:127:17", stacktrace);
+ checkTopFunction("type_cast_vm_test.dart:113:17", stacktrace);
}
return result;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698