OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library barback.test.package_graph.transform_test; | 5 library barback.test.package_graph.transform_test; |
6 | 6 |
7 import 'package:barback/src/utils.dart'; | 7 import 'package:barback/src/utils.dart'; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../utils.dart'; | 10 import '../utils.dart'; |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 expectAsset("pkg1|b", "spread out"); | 1048 expectAsset("pkg1|b", "spread out"); |
1049 expectAsset("pkg1|c.done", "spread out.done"); | 1049 expectAsset("pkg1|c.done", "spread out.done"); |
1050 buildShouldSucceed(); | 1050 buildShouldSucceed(); |
1051 | 1051 |
1052 modifyAsset("pkg2|a.inc", "b"); | 1052 modifyAsset("pkg2|a.inc", "b"); |
1053 updateSources(["pkg2|a.inc"]); | 1053 updateSources(["pkg2|a.inc"]); |
1054 expectAsset("pkg1|b", "spread out"); | 1054 expectAsset("pkg1|b", "spread out"); |
1055 expectNoAsset("pkg1|c.done"); | 1055 expectNoAsset("pkg1|c.done"); |
1056 buildShouldSucceed(); | 1056 buildShouldSucceed(); |
1057 }); | 1057 }); |
| 1058 |
| 1059 test("sees a transformer that's newly applied to a cross-package " |
| 1060 "dependency", () { |
| 1061 initGraph({ |
| 1062 "pkg1|a.txt": "pkg2|a.inc", |
| 1063 "pkg2|a.inc": "a" |
| 1064 }, { |
| 1065 "pkg1": [[new ManyToOneTransformer("txt")]], |
| 1066 "pkg2": [[new CheckContentTransformer("b", " transformed")]] |
| 1067 }); |
| 1068 |
| 1069 updateSources(["pkg1|a.txt", "pkg2|a.inc"]); |
| 1070 expectAsset("pkg1|a.out", "a"); |
| 1071 buildShouldSucceed(); |
| 1072 |
| 1073 modifyAsset("pkg2|a.inc", "b"); |
| 1074 updateSources(["pkg2|a.inc"]); |
| 1075 expectAsset("pkg1|a.out", "b transformed"); |
| 1076 buildShouldSucceed(); |
| 1077 }); |
| 1078 |
| 1079 test("doesn't see a transformer that's newly not applied to a " |
| 1080 "cross-package dependency", () { |
| 1081 initGraph({ |
| 1082 "pkg1|a.txt": "pkg2|a.inc", |
| 1083 "pkg2|a.inc": "a" |
| 1084 }, { |
| 1085 "pkg1": [[new ManyToOneTransformer("txt")]], |
| 1086 "pkg2": [[new CheckContentTransformer("a", " transformed")]] |
| 1087 }); |
| 1088 |
| 1089 updateSources(["pkg1|a.txt", "pkg2|a.inc"]); |
| 1090 expectAsset("pkg1|a.out", "a transformed"); |
| 1091 buildShouldSucceed(); |
| 1092 |
| 1093 modifyAsset("pkg2|a.inc", "b"); |
| 1094 updateSources(["pkg2|a.inc"]); |
| 1095 expectAsset("pkg1|a.out", "b"); |
| 1096 buildShouldSucceed(); |
| 1097 }); |
1058 }); | 1098 }); |
1059 } | 1099 } |
OLD | NEW |