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

Unified Diff: test/codegen/misc.dart

Issue 1183453005: fixes #226 super == and fixes #227 escape \r \f (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 | « test/codegen/expect/misc.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/misc.dart
diff --git a/test/codegen/misc.dart b/test/codegen/misc.dart
index 4bde2571312ed0648287dacf4828e5eb1a913bbf..f40d220304fd42565de717dbf9e7046c52438eba 100644
--- a/test/codegen/misc.dart
+++ b/test/codegen/misc.dart
@@ -11,6 +11,37 @@ class Generic<T> {
Type get type => Generic;
}
+// super ==
+// https://github.com/dart-lang/dev_compiler/issues/226
+class Base {
+ int x = 1, y = 2;
+ operator==(obj) {
+ return obj is Base && obj.x == x && obj.y == y;
+ }
+}
+class Derived {
+ int z = 3;
+ operator==(obj) {
+ return obj is Derived && obj.z == z && super == obj;
+ }
+}
+
+// string escape tests
+// https://github.com/dart-lang/dev_compiler/issues/227
+bool _isWhitespace(String ch) =>
+ ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
+
+const _escapeMap = const {
+ '\n': r'\n',
+ '\r': r'\r',
+ '\f': r'\f',
+ '\b': r'\b',
+ '\t': r'\t',
+ '\v': r'\v',
+ '\x7F': r'\x7F', // delete
+};
+
+
main() {
// Number literals in call expressions.
print(1.toString());
@@ -24,4 +55,6 @@ main() {
// Should be Generic<dynamic>
print(new Generic<int>().type);
+
+ print(new Derived() == new Derived()); // true
}
« no previous file with comments | « test/codegen/expect/misc.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698