Chromium Code Reviews| Index: pkg/barback/test/package_graph/repetition_test.dart |
| diff --git a/pkg/barback/test/package_graph/repetition_test.dart b/pkg/barback/test/package_graph/repetition_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cd9844049aaa42e72676ea80d4cbcf517d1bc47a |
| --- /dev/null |
| +++ b/pkg/barback/test/package_graph/repetition_test.dart |
| @@ -0,0 +1,70 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library barback.test.package_graph.transform_test; |
| + |
| +import 'package:barback/src/utils.dart'; |
| +import 'package:scheduled_test/scheduled_test.dart'; |
| + |
| +import '../utils.dart'; |
| + |
| +main() { |
|
Bob Nystrom
2013/10/28 16:51:30
Can you add some documentation here explaining wha
nweiz
2013/10/28 23:54:49
Done.
|
| + initConfig(); |
| + |
| + test("updates sources many times", () { |
| + initGraph(["app|foo.txt"], { |
| + "app": [[new RewriteTransformer("txt", "out")]] |
| + }); |
| + |
| + for (var i = 0; i < 1000; i++) { |
| + updateSources(["app|foo.txt"]); |
| + } |
| + |
| + expectAsset("app|foo.out", "foo.out"); |
| + buildShouldSucceed(); |
| + }); |
| + |
| + test("updates and then removes sources many times", () { |
| + initGraph(["app|foo.txt"], { |
| + "app": [[new RewriteTransformer("txt", "out")]] |
| + }); |
| + |
| + for (var i = 0; i < 1000; i++) { |
| + updateSources(["app|foo.txt"]); |
| + removeSources(["app|foo.txt"]); |
| + } |
| + |
| + expectNoAsset("app|foo.out"); |
| + expectNoAsset("app|foo.txt"); |
| + buildShouldSucceed(); |
| + }); |
| + |
| + test("updates transformers many times", () { |
| + var rewrite = new RewriteTransformer("txt", "out"); |
| + initGraph(["app|foo.txt"], {"app": [[rewrite]]}); |
| + updateSources(["app|foo.txt"]); |
| + |
| + for (var i = 0; i < 1; i++) { |
|
Bob Nystrom
2013/10/28 16:51:30
That's not very many times.
nweiz
2013/10/28 23:54:49
Oops, left over from debuggnig. Fixed.
|
| + updateTransformers("app", [[rewrite]]); |
| + } |
| + |
| + expectAsset("app|foo.out", "foo.out"); |
| + buildShouldSucceed(); |
| + }); |
| + |
| + test("updates and removes transformers many times", () { |
| + var rewrite = new RewriteTransformer("txt", "out"); |
| + initGraph(["app|foo.txt"], {"app": [[rewrite]]}); |
| + updateSources(["app|foo.txt"]); |
| + |
| + for (var i = 0; i < 1; i++) { |
|
Bob Nystrom
2013/10/28 16:51:30
Ditto.
nweiz
2013/10/28 23:54:49
Done.
|
| + updateTransformers("app", [[rewrite]]); |
| + updateTransformers("app", [[]]); |
| + } |
| + |
| + expectAsset("app|foo.txt", "foo"); |
| + expectNoAsset("app|foo.out"); |
| + buildShouldSucceed(); |
| + }); |
| +} |