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