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

Side by Side Diff: tests/compiler/dart2js/type_representation_test.dart

Issue 27510003: Scanner for UTF-8 byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixes compiler tests Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library subtype_test; 5 library subtype_test;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import 'type_test_helper.dart'; 9 import 'type_test_helper.dart';
10 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; 10 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart';
(...skipping 19 matching lines...) Expand all
30 m6(int a, [String b]) {} 30 m6(int a, [String b]) {}
31 m7(int a, String b, [List<int> c, d]) {} 31 m7(int a, String b, [List<int> c, d]) {}
32 m8(int a, {String b}) {} 32 m8(int a, {String b}) {}
33 m9(int a, String b, {List<int> c, d}) {} 33 m9(int a, String b, {List<int> c, d}) {}
34 m10(void f(int a, [b])) {} 34 m10(void f(int a, [b])) {}
35 """).then((env) { 35 """).then((env) {
36 TypeRepresentationGenerator typeRepresentation = 36 TypeRepresentationGenerator typeRepresentation =
37 new TypeRepresentationGenerator(env.compiler); 37 new TypeRepresentationGenerator(env.compiler);
38 38
39 Expression onVariable(TypeVariableType variable) { 39 Expression onVariable(TypeVariableType variable) {
40 return new VariableUse(variable.name.slowToString()); 40 return new VariableUse(variable.name);
41 } 41 }
42 42
43 String stringify(Expression expression) { 43 String stringify(Expression expression) {
44 return prettyPrint(expression, env.compiler).buffer.toString(); 44 return prettyPrint(expression, env.compiler).buffer.toString();
45 } 45 }
46 46
47 void expect(String expectedRepresentation, DartType type) { 47 void expect(String expectedRepresentation, DartType type) {
48 Expression expression = 48 Expression expression =
49 typeRepresentation.getTypeRepresentation(type, onVariable); 49 typeRepresentation.getTypeRepresentation(type, onVariable);
50 Expect.stringEquals(expectedRepresentation, stringify(expression)); 50 Expect.stringEquals(expectedRepresentation, stringify(expression));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 // m10(void f(int a, [b])) {} 157 // m10(void f(int a, [b])) {}
158 expect('{$func: "dynamic__void__int__dynamic", $args:' 158 expect('{$func: "dynamic__void__int__dynamic", $args:'
159 ' [{$func: "void__int__dynamic",' 159 ' [{$func: "void__int__dynamic",'
160 ' $retvoid: true, $args: [$int_rep], $opt: [null]}]}', 160 ' $retvoid: true, $args: [$int_rep], $opt: [null]}]}',
161 env.getElement('m10').computeType(env.compiler)); 161 env.getElement('m10').computeType(env.compiler));
162 })); 162 }));
163 } 163 }
164 164
165 165
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698