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

Unified Diff: tests/compiler/dart2js/unparser_test.dart

Issue 10866017: dart2dart Fix type variables rename (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
Index: tests/compiler/dart2js/unparser_test.dart
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index a2e2f1617cadc44a76cf4332bac56bbb7b9d8d0c..fd253c9ac6861f55e4c53f98ca65f5f4632d6a23 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -520,17 +520,21 @@ testTypeVariablesAreRenamed() {
// both should be renamed.
var librarySrc = '''
#library('mylib');
+typedef void MyFunction<T extends num>(T arg);
class T {}
class B<T> {}
class A<T> extends B<T> { T f; }
''';
var mainSrc = '''
#import('mylib.dart', prefix: 'mylib');
+typedef void MyFunction<T extends num>(T arg);
class T {}
class B<T> {}
class A<T> extends B<T> { T f; }
main() {
+ MyFunction myf1;
+ mylib.MyFunction myf2;
new A<int>().f;
new T();
@@ -539,9 +543,16 @@ main() {
}
''';
var expectedResult =
- 'class T{}class B<T>{}class A<T> extends B<T>{T f;}'
- 'class p_T{}class p_B<p_T>{}class p_A<p_T> extends p_B<p_T>{p_T f;}'
- 'main(){new p_A<int>().f; new p_T(); new A<int>().f; new T();}';
+ 'typedef void MyFunction<T extends num>(T arg);'
+ 'class T{}'
+ 'class B<T>{}'
+ 'class A<T> extends B<T>{T f;}'
+ 'typedef void p_MyFunction<p_T extends num>(p_T arg);'
+ 'class p_T{}'
+ 'class p_B<p_T>{}'
+ 'class p_A<p_T> extends p_B<p_T>{p_T f;}'
+ 'main(){p_MyFunction myf1; MyFunction myf2; new p_A<int>().f; '
+ 'new p_T(); new A<int>().f; new T();}';
testDart2DartWithLibrary(mainSrc, librarySrc,
(String result) { Expect.equals(expectedResult, result); });
}

Powered by Google App Engine
This is Rietveld 408576698