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

Unified Diff: dart/tests/language/src/ImpliedInterfaceTest.dart

Issue 9839103: Fix ImpliedInterfaceTest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « dart/tests/language/language-leg.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/src/ImpliedInterfaceTest.dart
diff --git a/dart/tests/language/src/ImpliedInterfaceTest.dart b/dart/tests/language/src/ImpliedInterfaceTest.dart
index 54672380c3210904364fcde56f6fb61385a1e674..3779ef5600866c171258e5473b886ea513cc40b7 100644
--- a/dart/tests/language/src/ImpliedInterfaceTest.dart
+++ b/dart/tests/language/src/ImpliedInterfaceTest.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// 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.
@@ -8,12 +8,22 @@ class BaseClass {
toString() => "BaseClass";
}
+/**
+ * This class declaration causes an intentional type warning as it
+ * isn't marked abstract. It is abstract because it doesn't
+ * "implement" the field foo.
+ */
class ImplementsClass implements BaseClass {
ImplementsClass() {}
}
interface ExtendsClass extends BaseClass {}
+/**
+ * This class declaration causes an intentional type warning as it
+ * isn't marked abstract. It is abstract because it doesn't
+ * "implement" the field foo.
+ */
class ImplementsExtendsClass implements ExtendsClass {
ImplementsExtendsClass() {}
}
@@ -21,10 +31,17 @@ class ImplementsExtendsClass implements ExtendsClass {
main() {
ImplementsClass c1 = new ImplementsClass();
ImplementsExtendsClass c2 = new ImplementsExtendsClass();
- if (false) {
- // Verify we don't inherit the field from BaseClass
- Expect.equals(0, c1.foo); // 01: compile-time error
ahe 2012/03/25 13:31:18 Notice: this was never a multi-test. It says //, n
Lasse Reichstein Nielsen 2012/03/25 18:16:46 Any idea why anyone would have thought this to be
ahe 2012/03/27 14:49:42 I think there may have been some confusion about w
- Expect.equals(0, c2.foo); // 02: compile-time error
+ try {
+ c1.foo;
+ Expect.fail('expected a NoSuchMethodException');
+ } catch (NoSuchMethodException ex) {
+ // Expected error.
+ }
+ try {
+ c2.foo;
+ Expect.fail('expected a NoSuchMethodException');
+ } catch (NoSuchMethodException ex) {
+ // Expected error.
}
Expect.equals(true, c1 is BaseClass);
Expect.equals(true, c1 is !ExtendsClass);
@@ -34,6 +51,6 @@ main() {
Expect.equals("BaseClass", "${new BaseClass()}");
// Verify we don't inherit toString from BaseClass
- Expect.equals("${new Object()}", "${c1}");
- Expect.equals("${new Object()}", "${c2}");
+ Expect.notEquals("BaseClass", "${c1}");
+ Expect.notEquals("BaseClass", "${c2}");
}
« no previous file with comments | « dart/tests/language/language-leg.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698