Fix pathos->path in watcher example.
BUG=
R=nweiz@google.com
Review URL: https://codereview.chromium.org//18878003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/watcher@24976 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkgs/watcher/example/watch.dart b/pkgs/watcher/example/watch.dart
index 247f66a..235578d 100644
--- a/pkgs/watcher/example/watch.dart
+++ b/pkgs/watcher/example/watch.dart
@@ -7,7 +7,7 @@
import 'dart:io';
-import 'package:pathos/path.dart' as pathos;
+import 'package:path/path.dart' as p;
import 'package:watcher/watcher.dart';
main() {
@@ -17,7 +17,7 @@
return;
}
- var watcher = new DirectoryWatcher(pathos.absolute(args[0]));
+ var watcher = new DirectoryWatcher(p.absolute(args[0]));
watcher.events.listen((event) {
print(event);
});
diff --git a/pkgs/watcher/test/utils.dart b/pkgs/watcher/test/utils.dart
index 387b4ad..7b3da02 100644
--- a/pkgs/watcher/test/utils.dart
+++ b/pkgs/watcher/test/utils.dart
@@ -7,7 +7,7 @@
import 'dart:async';
import 'dart:io';
-import 'package:path/path.dart';
+import 'package:path/path.dart' as p;
import 'package:scheduled_test/scheduled_test.dart';
import 'package:unittest/compact_vm_config.dart';
import 'package:watcher/watcher.dart';
@@ -50,10 +50,10 @@
_mockFileModificationTimes = new Map<String, int>();
mockGetModificationTime((path) {
- path = relative(path, from: _sandboxDir);
+ path = p.relative(path, from: _sandboxDir);
// Make sure we got a path in the sandbox.
- assert(isRelative(path) && !path.startsWith(".."));
+ assert(p.isRelative(path) && !path.startsWith(".."));
return new DateTime.fromMillisecondsSinceEpoch(
_mockFileModificationTimes[path]);
@@ -109,15 +109,15 @@
}
void expectAddEvent(String path) {
- expectEvent(ChangeType.ADD, join(_sandboxDir, path));
+ expectEvent(ChangeType.ADD, p.join(_sandboxDir, path));
}
void expectModifyEvent(String path) {
- expectEvent(ChangeType.MODIFY, join(_sandboxDir, path));
+ expectEvent(ChangeType.MODIFY, p.join(_sandboxDir, path));
}
void expectRemoveEvent(String path) {
- expectEvent(ChangeType.REMOVE, join(_sandboxDir, path));
+ expectEvent(ChangeType.REMOVE, p.join(_sandboxDir, path));
}
/// Schedules writing a file in the sandbox at [path] with [contents].
@@ -129,10 +129,10 @@
if (updateModified == null) updateModified = true;
schedule(() {
- var fullPath = join(_sandboxDir, path);
+ var fullPath = p.join(_sandboxDir, path);
// Create any needed subdirectories.
- var dir = new Directory(dirname(fullPath));
+ var dir = new Directory(p.dirname(fullPath));
if (!dir.existsSync()) {
dir.createSync(recursive: true);
}
@@ -150,7 +150,7 @@
/// Schedules deleting a file in the sandbox at [path].
void deleteFile(String path) {
schedule(() {
- new File(join(_sandboxDir, path)).deleteSync();
+ new File(p.join(_sandboxDir, path)).deleteSync();
});
}
@@ -159,7 +159,7 @@
/// If [contents] is omitted, creates an empty file.
void renameFile(String from, String to) {
schedule(() {
- new File(join(_sandboxDir, from)).renameSync(join(_sandboxDir, to));
+ new File(p.join(_sandboxDir, from)).renameSync(p.join(_sandboxDir, to));
// Manually update the mock modification time for the file.
var milliseconds = _mockFileModificationTimes.putIfAbsent(to, () => 0);