Fix path tests on windows.

BUG=

Review URL: https://codereview.chromium.org//11472045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15883 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
rnystrom@google.com 2012-12-08 05:11:32 +00:00
parent a050d4147d
commit c9bacbbdb4

View file

@ -226,9 +226,14 @@ main() {
if (io.Platform.operatingSystem == 'windows') {
test('given absolute path', () {
var b = new path.Builder(style: path.Style.windows);
expect(r.relative(r'C:\'), b.join(b.relative(r'C:\'), r'..\..'));
expect(r.relative(r'C:\a\b'),
b.join(b.relative(r'C:\'), r'..\..\a\b'));
// TODO(rnystrom): Use a path method here to get the root prefix
// when one exists.
var drive = path.current.substring(0, 3);
expect(r.relative(drive), b.join(b.relative(drive), r'..\..'));
expect(r.relative(b.join(drive, r'a\b')),
b.join(b.relative(drive), r'..\..\a\b'));
// TODO(rnystrom): Test behavior when drive letters differ.
});
}