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

Unified Diff: tests/language_strong/tearoff_dynamic_test.dart

Issue 2873073002: fix #29585, implement equality for tearoffs (Closed)
Patch Set: merged Created 3 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 | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language_strong/tearoff_dynamic_test.dart
diff --git a/tests/language_strong/tearoff_dynamic_test.dart b/tests/language_strong/tearoff_dynamic_test.dart
index 9d324d6a6347cccaa9d6e179da32766e4376d23b..e23c22fc493d09ab14e32bdac5903831391748b6 100644
--- a/tests/language_strong/tearoff_dynamic_test.dart
+++ b/tests/language_strong/tearoff_dynamic_test.dart
@@ -5,6 +5,7 @@ import 'package:expect/expect.dart';
class Foo {
dynamic method(int x) {}
+ dynamic method2(int x) {}
}
main() {
@@ -15,4 +16,14 @@ main() {
dynamic dynamicMethod2 = (foo as dynamic).method;
Expect.throws(() => dynamicMethod2(2.5));
+
+ Expect.equals(dynamicMethod1, dynamicMethod1);
+ Expect.equals(dynamicMethod1, dynamicMethod2);
+ Expect.equals(dynamicMethod1, foo.method);
+ Expect.equals(foo.method2, (foo as dynamic).method2);
+
+ Expect.notEquals(dynamicMethod1, new Foo().method);
+ Expect.notEquals(dynamicMethod1, (new Foo() as dynamic).method);
+ Expect.notEquals(dynamicMethod1, foo.method2);
+ Expect.notEquals(dynamicMethod1, (foo as dynamic).method2);
}
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698