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

Side by Side Diff: pkg/analyzer2dart/test/end2end_test.dart

Issue 666863002: Support conditional expressions in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Visit conditionally. Created 6 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// End-to-end test of the analyzer2dart compiler. 5 /// End-to-end test of the analyzer2dart compiler.
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'mock_sdk.dart'; 9 import 'mock_sdk.dart';
10 import 'package:analyzer/file_system/memory_file_system.dart'; 10 import 'package:analyzer/file_system/memory_file_system.dart';
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 ''', ''' 477 ''', '''
478 main(a) { 478 main(a) {
479 if (a) { 479 if (a) {
480 print(0); 480 print(0);
481 } else { 481 } else {
482 print(1); 482 print(1);
483 print(2); 483 print(2);
484 } 484 }
485 } 485 }
486 '''); 486 ''');
487 });
487 488
489 test('If statement', () {
490 checkResult('''
491 main(a) {
492 return a ? print(0) : print(1);
493 }
494 ''', '''
495 main(a) {
496 return a ? print(0) : print(1);
497 }
498 ''');
488 }); 499 });
489 } 500 }
490 501
491 checkResult(String input, [String expectedOutput]) { 502 checkResult(String input, [String expectedOutput]) {
492 if (expectedOutput == null) { 503 if (expectedOutput == null) {
493 expectedOutput = input; 504 expectedOutput = input;
494 } 505 }
495 506
496 CollectingOutputProvider outputProvider = new CollectingOutputProvider(); 507 CollectingOutputProvider outputProvider = new CollectingOutputProvider();
497 MemoryResourceProvider provider = new MemoryResourceProvider(); 508 MemoryResourceProvider provider = new MemoryResourceProvider();
(...skipping 25 matching lines...) Expand all
523 sb.write(text); 534 sb.write(text);
524 } 535 }
525 536
526 void addError(errorEvent, [StackTrace stackTrace]) {} 537 void addError(errorEvent, [StackTrace stackTrace]) {}
527 538
528 void close() {} 539 void close() {}
529 540
530 String get text => sb.toString(); 541 String get text => sb.toString();
531 } 542 }
532 543
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698