OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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 pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:scheduled_test/scheduled_stream.dart'; | 7 import 'package:scheduled_test/scheduled_stream.dart'; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 "foo": "1.2.3", | 141 "foo": "1.2.3", |
142 "bar": "1.2.3" | 142 "bar": "1.2.3" |
143 }, | 143 }, |
144 "transformers": ["foo", "bar"] | 144 "transformers": ["foo", "bar"] |
145 }), | 145 }), |
146 d.dir("bin", [ | 146 d.dir("bin", [ |
147 d.file("myapp.dart", "main() => print('Hello!');") | 147 d.file("myapp.dart", "main() => print('Hello!');") |
148 ]) | 148 ]) |
149 ]).create(); | 149 ]).create(); |
150 | 150 |
| 151 pubGet(); |
151 process = pubRun(args: ['myapp']); | 152 process = pubRun(args: ['myapp']); |
152 process.stdout.expect("See ya!"); | 153 process.stdout.expect("See ya!"); |
153 process.shouldExit(); | 154 process.shouldExit(); |
154 | 155 |
155 d.dir(appPath, [ | 156 d.dir(appPath, [ |
156 d.dir(".pub/transformers", [ | 157 d.dir(".pub/transformers", [ |
157 d.file("manifest.txt", "0.1.2+3\nbar,foo"), | 158 d.file("manifest.txt", "0.1.2+3\nbar,foo"), |
158 d.matcherFile("transformers.snapshot", isNot(isEmpty)) | 159 d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
159 ]) | 160 ]) |
160 ]).validate(); | 161 ]).validate(); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // around issue 20498. | 300 // around issue 20498. |
300 "baz": "1.2.3" | 301 "baz": "1.2.3" |
301 }, | 302 }, |
302 "transformers": ["foo"] | 303 "transformers": ["foo"] |
303 }), | 304 }), |
304 d.dir("bin", [ | 305 d.dir("bin", [ |
305 d.file("myapp.dart", "main() => print('Hello!');") | 306 d.file("myapp.dart", "main() => print('Hello!');") |
306 ]) | 307 ]) |
307 ]).create(); | 308 ]).create(); |
308 | 309 |
| 310 pubGet(); |
309 process = pubRun(args: ['myapp']); | 311 process = pubRun(args: ['myapp']); |
310 process.stdout.expect( | 312 process.stdout.expect("Goodbye!"); |
311 "Your pubspec has changed, so we need to update your lockfile:"); | |
312 process.stdout.expect(consumeThrough("Goodbye!")); | |
313 process.shouldExit(); | 313 process.shouldExit(); |
314 | 314 |
315 // "bar" should still be in the manifest, since there's no reason to | 315 // "bar" should still be in the manifest, since there's no reason to |
316 // recompile the cache. | 316 // recompile the cache. |
317 d.dir(appPath, [ | 317 d.dir(appPath, [ |
318 d.dir(".pub/transformers", [ | 318 d.dir(".pub/transformers", [ |
319 d.file("manifest.txt", "0.1.2+3\nbar,foo"), | 319 d.file("manifest.txt", "0.1.2+3\nbar,foo"), |
320 d.matcherFile("transformers.snapshot", isNot(isEmpty)) | 320 d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
321 ]) | 321 ]) |
322 ]).validate(); | 322 ]).validate(); |
(...skipping 14 matching lines...) Expand all Loading... |
337 Future apply(Transform transform) { | 337 Future apply(Transform transform) { |
338 return transform.primaryInput.readAsString().then((contents) { | 338 return transform.primaryInput.readAsString().then((contents) { |
339 transform.addOutput(new Asset.fromString( | 339 transform.addOutput(new Asset.fromString( |
340 transform.primaryInput.id, | 340 transform.primaryInput.id, |
341 contents.replaceAll("$input", "$output"))); | 341 contents.replaceAll("$input", "$output"))); |
342 }); | 342 }); |
343 } | 343 } |
344 } | 344 } |
345 """; | 345 """; |
346 } | 346 } |
OLD | NEW |