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

Unified Diff: test/codegen/language/runtime_type_test.dart

Issue 2076713002: Move type tagging logic out of setSignature (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Move type tagging logic out of setSignature Created 4 years, 6 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 | « lib/src/compiler/code_generator.dart ('k') | tool/input_sdk/private/ddc_runtime/classes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/language/runtime_type_test.dart
diff --git a/test/codegen/language/runtime_type_test.dart b/test/codegen/language/runtime_type_test.dart
index 158f97479d3ce40bfb0330643ac56415f2b1568a..8971ff908be2e8e97964da538ed81e63525189af 100644
--- a/test/codegen/language/runtime_type_test.dart
+++ b/test/codegen/language/runtime_type_test.dart
@@ -5,11 +5,31 @@
import "package:expect/expect.dart";
class A {
- get className => runtimeType;
+}
+
+class B {
}
main() {
- Expect.isTrue(new A().className is Type);
+ var a = new A();
+ var b = new B();
+ var f = () => null;
+ var classA = A;
+ var classB = B;
+
+ Expect.isTrue(a.runtimeType is Type);
+ Expect.equals(A, a.runtimeType);
+ Expect.notEquals(B, a.runtimeType);
+ Expect.notEquals(A, b.runtimeType);
+
+ Expect.isTrue(f.runtimeType is Type);
+ Expect.isFalse(f.runtimeType == a.runtimeType);
+
+ Expect.isTrue(classA.runtimeType is Type);
+ Expect.isTrue(classA.runtimeType == classB.runtimeType);
+ Expect.isFalse(classA.runtimeType == a.runtimeType);
+ Expect.isFalse(classA.runtimeType == f.runtimeType);
Jennifer Messerly 2016/06/27 18:04:01 Oh nice fix! Should we add a test like: Expect.i
andrewkrieger 2016/06/27 22:24:54 Done. Will land the CL soon.
+
Expect.isTrue(null.runtimeType is Type);
- Expect.equals(null.runtimeType, Null);
+ Expect.equals(Null, null.runtimeType);
}
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | tool/input_sdk/private/ddc_runtime/classes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698