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

Side by Side Diff: pkg/code_transformers/test/entry_point_test.dart

Issue 204033003: Updating code_transformers to not fail on syntax errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« no previous file with comments | « pkg/code_transformers/pubspec.yaml ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library code_transformers.test.assets_test; 5 library code_transformers.test.assets_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' show File, Platform; 8 import 'dart:io' show File, Platform;
9 9
10 import 'package:barback/barback.dart'; 10 import 'package:barback/barback.dart';
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 expectation: true); 69 expectation: true);
70 }); 70 });
71 71
72 test('should count parts as main', () { 72 test('should count parts as main', () {
73 return checkDartEntry( 73 return checkDartEntry(
74 inputs: { 74 inputs: {
75 'a|web/main.dart': 'part "foo.dart";', 75 'a|web/main.dart': 'part "foo.dart";',
76 }, 76 },
77 expectation: true); 77 expectation: true);
78 }); 78 });
79
80 test('is tolerant of syntax errors with main', () {
81 return checkDartEntry(
82 inputs: {
83 'a|web/main.dart': 'main() {} {',
84 },
85 expectation: true);
86 });
87
88 test('is tolerant of syntax errors without main', () {
89 return checkDartEntry(
90 inputs: {
91 'a|web/main.dart': 'class Foo {',
92 },
93 expectation: false);
94 });
79 }); 95 });
80 } 96 }
81 97
82 class Validator extends Transformer { 98 class Validator extends Transformer {
83 final Function validation; 99 final Function validation;
84 100
85 Validator(this.validation); 101 Validator(this.validation);
86 102
87 Future<bool> isPrimary(Asset input) => new Future.value(true); 103 Future<bool> isPrimary(Asset input) => new Future.value(true);
88 104
89 Future apply(Transform transform) { 105 Future apply(Transform transform) {
90 return new Future.value(validation(transform)); 106 return new Future.value(validation(transform));
91 } 107 }
92 } 108 }
OLDNEW
« no previous file with comments | « pkg/code_transformers/pubspec.yaml ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698