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

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

Issue 12042003: Move relational operators to the new interceptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import 'compiler_helper.dart'; 5 import 'compiler_helper.dart';
6 6
7 const int REMOVED = 0; 7 const int REMOVED = 0;
8 const int ABOVE_ZERO = 1; 8 const int ABOVE_ZERO = 1;
9 const int BELOW_LENGTH = 2; 9 const int BELOW_LENGTH = 2;
10 const int KEPT = 3; 10 const int KEPT = 3;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 operator +(other) {} 234 operator +(other) {}
235 operator -(other) {} 235 operator -(other) {}
236 operator ~/(other) {} 236 operator ~/(other) {}
237 operator /(other) {} 237 operator /(other) {}
238 operator *(other) {} 238 operator *(other) {}
239 operator <<(other) {} 239 operator <<(other) {}
240 operator >>(other) {} 240 operator >>(other) {}
241 operator |(other) {} 241 operator |(other) {}
242 operator &(other) {} 242 operator &(other) {}
243 operator ^(other) {} 243 operator ^(other) {}
244 operator <(other) {}
245 operator >(other) {}
246 operator <=(other) {}
247 operator >=(other) {}
248 operator ==(other) {}
244 } 249 }
245 class JSInt { 250 class JSInt extends JSNumber {
246 } 251 }
247 class JSDouble { 252 class JSDouble extends JSNumber {
248 } 253 }
249 class JSNull { 254 class JSNull {
250 } 255 }
251 class JSBool { 256 class JSBool {
252 } 257 }
253 class JSFunction { 258 class JSFunction {
254 } 259 }
255 class ObjectInterceptor { 260 class ObjectInterceptor {
256 } 261 }
257 getInterceptor(x) {}'''; 262 getInterceptor(x) {}''';
258 263
259 expect(String code, int kind) { 264 expect(String code, int kind) {
260 String generated = compile( 265 String generated = compile(
261 code, 266 code,
262 coreSource: DEFAULT_CORELIB_WITH_LIST_INTERFACE, 267 coreSource: DEFAULT_CORELIB_WITH_LIST_INTERFACE,
263 interceptorsSource: INTERCEPTORSLIB_WITH_MEMBERS); 268 interceptorsSource: INTERCEPTORSLIB_WITH_MEMBERS);
269 print(generated);
kasperl 2013/01/21 09:45:11 Remove again?
ngeoffray 2013/01/21 10:41:44 Done.
264 switch (kind) { 270 switch (kind) {
265 case REMOVED: 271 case REMOVED:
266 Expect.isTrue(!generated.contains('ioore')); 272 Expect.isTrue(!generated.contains('ioore'));
267 break; 273 break;
268 274
269 case ABOVE_ZERO: 275 case ABOVE_ZERO:
270 Expect.isTrue(!generated.contains('< 0')); 276 Expect.isTrue(!generated.contains('< 0'));
271 Expect.isTrue(generated.contains('ioore')); 277 Expect.isTrue(generated.contains('ioore'));
272 Expect.isTrue(generated.contains('ioore')); 278 Expect.isTrue(generated.contains('ioore'));
273 break; 279 break;
(...skipping 20 matching lines...) Expand all
294 break; 300 break;
295 } 301 }
296 } 302 }
297 303
298 304
299 main() { 305 main() {
300 for (int i = 0; i < TESTS.length; i += 2) { 306 for (int i = 0; i < TESTS.length; i += 2) {
301 expect(TESTS[i], TESTS[i + 1]); 307 expect(TESTS[i], TESTS[i + 1]);
302 } 308 }
303 } 309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698