@@ -5,6 +5,7 @@ import 'dart:async';
55import 'dart:convert' ;
66
77import 'package:logging/logging.dart' ;
8+ import 'package:path/path.dart' as path;
89import 'package:test/test.dart' ;
910import 'package:watcher/watcher.dart' ;
1011
@@ -40,8 +41,8 @@ main() {
4041 checkOutputs ({'a|web/a.txt.copy' : 'a' ,}, result, writer.assets);
4142
4243 await writer.writeAsString (makeAsset ('a|web/a.txt' , 'b' ));
43- FakeWatcher
44- . notifyWatchers ( new WatchEvent (ChangeType .MODIFY , 'a/ web/ a.txt' ));
44+ FakeWatcher . notifyWatchers (
45+ new WatchEvent (ChangeType .MODIFY , path. join ( 'a' , ' web' , ' a.txt') ));
4546
4647 result = await nextResult (results);
4748 checkOutputs ({'a|web/a.txt.copy' : 'b' ,}, result, writer.assets);
@@ -57,8 +58,8 @@ main() {
5758 checkOutputs ({'a|web/a.txt.copy' : 'a' ,}, result, writer.assets);
5859
5960 await writer.writeAsString (makeAsset ('a|web/b.txt' , 'b' ));
60- FakeWatcher
61- . notifyWatchers ( new WatchEvent (ChangeType .ADD , 'a/ web/ b.txt' ));
61+ FakeWatcher . notifyWatchers (
62+ new WatchEvent (ChangeType .ADD , path. join ( 'a' , ' web' , ' b.txt') ));
6263
6364 result = await nextResult (results);
6465 checkOutputs ({'a|web/b.txt.copy' : 'b' ,}, result, writer.assets);
@@ -78,8 +79,8 @@ main() {
7879 result, writer.assets);
7980
8081 await writer.delete (makeAssetId ('a|web/a.txt' ));
81- FakeWatcher
82- . notifyWatchers ( new WatchEvent (ChangeType .REMOVE , 'a/ web/ a.txt' ));
82+ FakeWatcher . notifyWatchers (
83+ new WatchEvent (ChangeType .REMOVE , path. join ( 'a' , ' web' , ' a.txt') ));
8384
8485 result = await nextResult (results);
8586
@@ -104,11 +105,11 @@ main() {
104105 result, writer.assets);
105106
106107 await writer.writeAsString (makeAsset ('a|web/c.txt' , 'c' ));
107- FakeWatcher
108- . notifyWatchers ( new WatchEvent (ChangeType .ADD , 'a/ web/ c.txt' ));
108+ FakeWatcher . notifyWatchers (
109+ new WatchEvent (ChangeType .ADD , path. join ( 'a' , ' web' , ' c.txt') ));
109110 await writer.delete (makeAssetId ('a|web/a.txt' ));
110- FakeWatcher
111- . notifyWatchers ( new WatchEvent (ChangeType .REMOVE , 'a/ web/ a.txt' ));
111+ FakeWatcher . notifyWatchers (
112+ new WatchEvent (ChangeType .REMOVE , path. join ( 'a' , ' web' , ' a.txt') ));
112113
113114 result = await nextResult (results);
114115 checkOutputs ({'a|web/c.txt.copy' : 'c' }, result, writer.assets);
@@ -141,8 +142,8 @@ main() {
141142 await writer.writeAsString (makeAsset ('test|lib/test.dart' , '' ),
142143 lastModified: new DateTime .now ().add (new Duration (days: 1 )));
143144 await writer.writeAsString (makeAsset ('a|web/a.txt' , 'b' ));
144- FakeWatcher
145- . notifyWatchers ( new WatchEvent (ChangeType .MODIFY , 'a/ web/ a.txt' ));
145+ FakeWatcher . notifyWatchers (
146+ new WatchEvent (ChangeType .MODIFY , path. join ( 'a' , ' web' , ' a.txt') ));
146147
147148 result = await nextResult (results);
148149 expect (result.status, BuildStatus .Failure );
@@ -165,8 +166,8 @@ main() {
165166 result, writer.assets);
166167
167168 await writer.writeAsString (makeAsset ('a|web/a.txt' , 'b' ));
168- FakeWatcher
169- . notifyWatchers ( new WatchEvent (ChangeType .MODIFY , 'a/ web/ a.txt' ));
169+ FakeWatcher . notifyWatchers (
170+ new WatchEvent (ChangeType .MODIFY , path. join ( 'a' , ' web' , ' a.txt') ));
170171
171172 result = await nextResult (results);
172173 checkOutputs ({'a|web/a.txt.copy' : 'b' , 'a|web/a.txt.copy.copy' : 'b' },
@@ -188,8 +189,8 @@ main() {
188189 result, writer.assets);
189190
190191 await writer.writeAsString (makeAsset ('a|web/b.txt' , 'b' ));
191- FakeWatcher
192- . notifyWatchers ( new WatchEvent (ChangeType .ADD , 'a/ web/ b.txt' ));
192+ FakeWatcher . notifyWatchers (
193+ new WatchEvent (ChangeType .ADD , path. join ( 'a' , ' web' , ' b.txt') ));
193194
194195 result = await nextResult (results);
195196 checkOutputs ({'a|web/b.txt.copy' : 'b' , 'a|web/b.txt.copy.copy' : 'b' },
@@ -219,8 +220,8 @@ main() {
219220 }, result, writer.assets);
220221
221222 await writer.delete (makeAssetId ('a|web/a.txt' ));
222- FakeWatcher
223- . notifyWatchers ( new WatchEvent (ChangeType .REMOVE , 'a/ web/ a.txt' ));
223+ FakeWatcher . notifyWatchers (
224+ new WatchEvent (ChangeType .REMOVE , path. join ( 'a' , ' web' , ' a.txt') ));
224225
225226 result = await nextResult (results);
226227 // Shouldn't rebuild anything, no outputs.
@@ -249,8 +250,8 @@ main() {
249250 result, writer.assets);
250251
251252 await writer.delete (makeAssetId ('a|web/a.txt.copy' ));
252- FakeWatcher .notifyWatchers (
253- new WatchEvent ( ChangeType .REMOVE , 'a/ web/ a.txt.copy' ));
253+ FakeWatcher .notifyWatchers (new WatchEvent (
254+ ChangeType .REMOVE , path. join ( 'a' , ' web' , ' a.txt.copy') ));
254255
255256 result = await nextResult (results);
256257 // Should rebuild the generated asset and its outputs.
@@ -275,8 +276,8 @@ main() {
275276 checkOutputs ({'a|web/a.txt.copy' : 'b' }, result, writer.assets);
276277
277278 await writer.writeAsString (makeAsset ('a|web/b.txt' , 'c' ));
278- FakeWatcher
279- . notifyWatchers ( new WatchEvent (ChangeType .MODIFY , 'a/ web/ b.txt' ));
279+ FakeWatcher . notifyWatchers (
280+ new WatchEvent (ChangeType .MODIFY , path. join ( 'a' , ' web' , ' b.txt') ));
280281
281282 result = await nextResult (results);
282283 checkOutputs ({'a|web/a.txt.copy' : 'c' }, result, writer.assets);
@@ -303,8 +304,8 @@ main() {
303304 result, writer.assets);
304305
305306 await writer.writeAsString (makeAsset ('a|web/b.txt' , 'c' ));
306- FakeWatcher
307- . notifyWatchers ( new WatchEvent (ChangeType .MODIFY , 'a/ web/ b.txt' ));
307+ FakeWatcher . notifyWatchers (
308+ new WatchEvent (ChangeType .MODIFY , path. join ( 'a' , ' web' , ' b.txt') ));
308309
309310 result = await nextResult (results);
310311 checkOutputs ({'a|web/a.txt.copy.copy' : 'c' }, result, writer.assets);
0 commit comments