Skip to content

Commit 6db186f

Browse files
authored
Fix tests on Mac OS X. (#1233)
1 parent 3a7f641 commit 6db186f

10 files changed

+29
-90
lines changed

LibTest/io/Directory/statSync_A01_t05.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ main() async {
2424
}
2525

2626
_main(Directory sandbox) async {
27-
Link link = getTempLinkSync(parent: sandbox);
27+
File file = getTempFileSync(parent: sandbox);
28+
Link link = getTempLinkSync(parent: sandbox, target: file.path);
2829
Directory dir = new Directory(link.path);
29-
Expect.equals(FileSystemEntityType.link, dir.statSync().type);
30+
// Links should be resolved.
31+
Expect.equals(FileSystemEntityType.file, dir.statSync().type);
3032
}

LibTest/io/Directory/stat_A01_t05.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ main() async {
2424
}
2525

2626
_main(Directory sandbox) async {
27-
Link link = getTempLinkSync(parent: sandbox);
27+
File file = getTempFileSync(parent: sandbox);
28+
Link link = getTempLinkSync(parent: sandbox, target: file.path);
2829
Directory dir = new Directory(link.path);
2930
asyncStart();
3031
await dir.stat().then((FileStat fs) {
31-
Expect.equals(FileSystemEntityType.link, fs.type);
32+
// Links should be resolved.
33+
Expect.equals(FileSystemEntityType.file, fs.type);
3234
asyncEnd();
3335
});
3436
}

LibTest/io/File/statSync_A01_t05.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ main() async {
2626
_main(Directory sandbox) async {
2727
Link link = getTempLinkSync(parent: sandbox);
2828
File file = new File(link.path);
29-
Expect.equals(FileSystemEntityType.link, file.statSync().type);
29+
// Links should be resolved.
30+
Expect.equals(FileSystemEntityType.directory, file.statSync().type);
3031
}

LibTest/io/File/stat_A01_t05.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ _main(Directory sandbox) async {
2828
File file = new File(link.path);
2929
asyncStart();
3030
await file.stat().then((FileStat fs) {
31-
Expect.equals(FileSystemEntityType.link, fs.type);
31+
// Links should be resolved.
32+
Expect.equals(FileSystemEntityType.directory, fs.type);
3233
asyncEnd();
3334
});
3435
}

LibTest/io/Link/statSync_A01_t01.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
///
1111
/// If the call fails, returns a FileStat object with .type set to
1212
/// FileSystemEntityType.notFound and the other fields invalid.
13-
/// @description Checks that this method synchronously calls the operating
14-
/// system's stat() function
13+
/// @description Checks that this method calls the operating system's stat()
14+
/// function. Test directory
1515
/// @author [email protected]
16-
/// @issue 24821
1716
1817
import "dart:io";
1918
import "../../../Utils/expect.dart";
@@ -24,6 +23,7 @@ main() async {
2423
}
2524

2625
_main(Directory sandbox) async {
27-
Link link = getTempLinkSync(parent: sandbox);
28-
Expect.equals(FileSystemEntityType.link, link.statSync().type);
26+
Directory dir = getTempDirectorySync(parent: sandbox);
27+
Link link = new Link(dir.path);
28+
Expect.equals(FileSystemEntityType.directory, link.statSync().type);
2929
}

LibTest/io/Link/statSync_A01_t04.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// If the call fails, returns a FileStat object with .type set to
1212
/// FileSystemEntityType.notFound and the other fields invalid.
1313
/// @description Checks that this method calls the operating system's stat()
14-
/// function. Test directory
14+
/// function. Test file
1515
/// @author [email protected]
1616
1717
import "dart:io";
@@ -23,7 +23,7 @@ main() async {
2323
}
2424

2525
_main(Directory sandbox) async {
26-
Directory dir = getTempDirectorySync(parent: sandbox);
27-
Link link = new Link(dir.path);
28-
Expect.equals(FileSystemEntityType.directory, link.statSync().type);
26+
File file = getTempFileSync(parent: sandbox);
27+
Link link = new Link(file.path);
28+
Expect.equals(FileSystemEntityType.file, link.statSync().type);
2929
}

LibTest/io/Link/statSync_A01_t05.dart

Lines changed: 0 additions & 29 deletions
This file was deleted.

LibTest/io/Link/stat_A01_t01.dart

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
/// If the call fails, completes the future with a FileStat object with .type set
1212
/// to FileSystemEntityType.notFound and the other fields invalid.
1313
/// @description Checks that this method calls the operating system's stat()
14-
/// function
14+
/// function. Test directory
1515
/// @author [email protected]
16-
/// @issue 24821
1716
1817
import "dart:io";
1918
import "../../../Utils/expect.dart";
@@ -24,15 +23,11 @@ main() async {
2423
}
2524

2625
_main(Directory sandbox) async {
27-
Link link = getTempLinkSync(parent: sandbox);
26+
Directory dir = getTempDirectorySync(parent: sandbox);
27+
Link link = new Link(dir.path);
2828
asyncStart();
2929
await link.stat().then((FileStat fs) {
30-
if (Platform.isWindows) {
31-
Expect.equals(FileSystemEntityType.link, fs.type);
32-
} else {
33-
Expect.equals(FileSystemEntityType.directory, fs.type);
34-
}
35-
}).then((_) {
30+
Expect.equals(FileSystemEntityType.directory, fs.type);
3631
asyncEnd();
3732
});
3833
}

LibTest/io/Link/stat_A01_t04.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// If the call fails, completes the future with a FileStat object with .type set
1212
/// to FileSystemEntityType.notFound and the other fields invalid.
1313
/// @description Checks that this method calls the operating system's stat()
14-
/// function. Test directory
14+
/// function. Test file
1515
/// @author [email protected]
1616
1717
import "dart:io";
@@ -23,11 +23,11 @@ main() async {
2323
}
2424

2525
_main(Directory sandbox) async {
26-
Directory dir = getTempDirectorySync(parent: sandbox);
27-
Link link = new Link(dir.path);
26+
File file = getTempFileSync(parent: sandbox);
27+
Link link = new Link(file.path);
2828
asyncStart();
2929
await link.stat().then((FileStat fs) {
30-
Expect.equals(FileSystemEntityType.directory, fs.type);
30+
Expect.equals(FileSystemEntityType.file, fs.type);
3131
asyncEnd();
3232
});
3333
}

LibTest/io/Link/stat_A01_t05.dart

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)