Index: pkg/barback/test/package_graph/source_test.dart |
diff --git a/pkg/barback/test/package_graph/source_test.dart b/pkg/barback/test/package_graph/source_test.dart |
index 0185679954c9b3b99ce0b716dad038923c0f8f1a..e6627e73bbbec87853bb8be0c42a6e63cccabd50 100644 |
--- a/pkg/barback/test/package_graph/source_test.dart |
+++ b/pkg/barback/test/package_graph/source_test.dart |
@@ -7,6 +7,7 @@ library barback.test.package_graph.source_test; |
import 'dart:async'; |
import 'package:barback/barback.dart'; |
+import 'package:barback/src/utils.dart'; |
import 'package:scheduled_test/scheduled_test.dart'; |
import '../utils.dart'; |
@@ -112,6 +113,24 @@ main() { |
buildShouldSucceed(); |
}); |
+ test("reloads an asset that's updated while loading", () { |
+ initGraph({"app|foo.txt": "foo"}); |
+ |
+ pauseProvider(); |
+ schedule(() { |
+ // The mock provider synchronously loads the value of the assets, so this |
+ // will kick off two loads with different values. The second one should |
+ // win. |
+ updateSources(["app|foo.txt"]); |
+ modifyAsset("app|foo.txt", "bar"); |
+ updateSources(["app|foo.txt"]); |
+ }); |
+ |
+ resumeProvider(); |
+ expectAsset("app|foo.txt", "bar"); |
+ buildShouldSucceed(); |
+ }); |
+ |
test("restarts a build if a source is updated while sources are loading", () { |
var transformer = new RewriteTransformer("txt", "out"); |
initGraph(["app|foo.txt", "app|other.bar"], {"app": [[transformer]]}); |