| Index: pkg/barback/test/package_graph/transform/transform_test.dart
|
| diff --git a/pkg/barback/test/package_graph/transform/transform_test.dart b/pkg/barback/test/package_graph/transform/transform_test.dart
|
| index 747512c723801f47c8d4c78e38253b3e7edbf521..8cc9085cc274661b5459f920c2d2de7f6a458ff8 100644
|
| --- a/pkg/barback/test/package_graph/transform/transform_test.dart
|
| +++ b/pkg/barback/test/package_graph/transform/transform_test.dart
|
| @@ -341,4 +341,46 @@ main() {
|
| expectAsset('app|bar.out', 'spread txt.out');
|
| buildShouldSucceed();
|
| });
|
| +
|
| + group("Transform.hasInput", () {
|
| + test("returns whether an input exists", () {
|
| + initGraph(["app|foo.txt", "app|bar.txt"], {'app': [
|
| + [new HasInputTransformer(['app|foo.txt', 'app|bar.txt', 'app|baz.txt'])]
|
| + ]});
|
| +
|
| + updateSources(['app|foo.txt', 'app|bar.txt']);
|
| + expectAsset('app|foo.txt',
|
| + 'app|foo.txt: true, app|bar.txt: true, app|baz.txt: false');
|
| + buildShouldSucceed();
|
| + });
|
| +
|
| + test("re-runs the transformer when an input stops existing", () {
|
| + initGraph(["app|foo.txt", "app|bar.txt"], {'app': [
|
| + [new HasInputTransformer(['app|bar.txt'])]
|
| + ]});
|
| +
|
| + updateSources(['app|foo.txt', 'app|bar.txt']);
|
| + expectAsset('app|foo.txt', 'app|bar.txt: true');
|
| + buildShouldSucceed();
|
| +
|
| + removeSources(['app|bar.txt']);
|
| + expectAsset('app|foo.txt', 'app|bar.txt: false');
|
| + buildShouldSucceed();
|
| + });
|
| +
|
| + // TODO(nweiz): enable this when issue 17480 is fixed.
|
| + // test("re-runs the transformer when an input starts existing", () {
|
| + // initGraph(["app|foo.txt", "app|bar.txt"], {'app': [
|
| + // [new HasInputTransformer(['app|bar.txt'])]
|
| + // ]});
|
| + //
|
| + // updateSources(['app|foo.txt']);
|
| + // expectAsset('app|foo.txt', 'app|bar.txt: false');
|
| + // buildShouldSucceed();
|
| + //
|
| + // updateSources(['app|bar.txt']);
|
| + // expectAsset('app|foo.txt', 'app|bar.txt: true');
|
| + // buildShouldSucceed();
|
| + // });
|
| + });
|
| }
|
|
|