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

Unified Diff: test/codegen/corelib/exception_implementation_test.dart

Issue 1945153002: Add corelib tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: error_test and range_error_test now pass Created 4 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
« no previous file with comments | « test/codegen/corelib/errors_test.dart ('k') | test/codegen/corelib/expando_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/corelib/exception_implementation_test.dart
diff --git a/test/codegen/language/exception_identity_test.dart b/test/codegen/corelib/exception_implementation_test.dart
similarity index 54%
copy from test/codegen/language/exception_identity_test.dart
copy to test/codegen/corelib/exception_implementation_test.dart
index 2b166078b431732debe3db5c1d0e34ca3c971b73..5df26a7d94a202be24cceb580fd45ce5a7bc72cb 100644
--- a/test/codegen/language/exception_identity_test.dart
+++ b/test/codegen/corelib/exception_implementation_test.dart
@@ -2,25 +2,16 @@
// 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.
+library exception_implementation_test;
import "package:expect/expect.dart";
-// Test that an object when thrown stays the same.
-
-class A {
- A();
-}
-
-check(exception) {
+main() {
+ final msg = 1;
try {
- throw exception;
- } catch (e) {
- Expect.equals(exception, e);
+ throw new Exception(msg);
+ Expect.fail("Unreachable");
+ } on Exception catch (e) {
+ Expect.isTrue(e is Exception);
+ Expect.equals("Exception: $msg", e.toString());
}
}
-
-main() {
- check("str");
- check(new A());
- check(1);
- check(1.2);
-}
« no previous file with comments | « test/codegen/corelib/errors_test.dart ('k') | test/codegen/corelib/expando_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698