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

Unified Diff: pkg/observe/test/transformer_test.dart

Issue 513023002: Step one towards stable error messages with details: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
« no previous file with comments | « pkg/observe/pubspec.yaml ('k') | pkg/observe/test/unique_message_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/test/transformer_test.dart
diff --git a/pkg/observe/test/transformer_test.dart b/pkg/observe/test/transformer_test.dart
index e21ffd424d42fe411ead7121c1f1339e66e37028..305e956a692ca94a8823ccbd3db5e9eef7819105 100644
--- a/pkg/observe/test/transformer_test.dart
+++ b/pkg/observe/test/transformer_test.dart
@@ -7,6 +7,7 @@ import 'package:barback/barback.dart';
import 'package:observe/transformer.dart';
import 'package:unittest/compact_vm_config.dart';
import 'package:unittest/unittest.dart';
+import 'package:stack_trace/stack_trace.dart';
main() {
useCompactVMConfiguration();
@@ -129,16 +130,19 @@ _testInitializers(String args, String expected) {
/// Helper that applies the transform by creating mock assets.
Future<String> _transform(String code) {
- var id = new AssetId('foo', 'a/b/c.dart');
- var asset = new Asset.fromString(id, code);
- var transformer = new ObservableTransformer();
- return transformer.isPrimary(asset).then((isPrimary) {
- expect(isPrimary, isTrue);
- var transform = new _MockTransform(asset);
- return transformer.apply(transform).then((_) {
- expect(transform.outs, hasLength(1));
- expect(transform.outs[0].id, id);
- return transform.outs.first.readAsString();
+ return Chain.capture(() {
+ var id = new AssetId('foo', 'a/b/c.dart');
+ var asset = new Asset.fromString(id, code);
+ var transformer = new ObservableTransformer();
+ return transformer.isPrimary(asset).then((isPrimary) {
+ expect(isPrimary, isTrue);
+ var transform = new _MockTransform(asset);
+ return transformer.apply(transform).then((_) {
+ expect(transform.outs, hasLength(2));
+ expect(transform.outs[0].id, id);
+ expect(transform.outs[1].id, id.addExtension('._buildLogs.1'));
+ return transform.outs.first.readAsString();
+ });
});
});
}
@@ -166,7 +170,8 @@ class _MockTransform implements Transform {
readInput(id) => throw new UnimplementedError();
readInputAsString(id, {encoding}) => throw new UnimplementedError();
- hasInput(id) => throw new UnimplementedError();
+ hasInput(id) =>
+ new Future.value(id == _asset.id || outs.any((a) => a.id == id));
static void _mockLogFn(AssetId asset, LogLevel level, String message,
span) {
« no previous file with comments | « pkg/observe/pubspec.yaml ('k') | pkg/observe/test/unique_message_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698