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

Unified Diff: pkg/barback/test/package_graph/repetition_test.dart

Issue 36463002: Fix a synchrony bug in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ });
+}
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698