Skip to content

Fix stat conformance tests to resolve links #1233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions LibTest/io/Directory/statSync_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ main() async {
}

_main(Directory sandbox) async {
Link link = getTempLinkSync(parent: sandbox);
File file = getTempFileSync(parent: sandbox);
Link link = getTempLinkSync(parent: sandbox, target: file.path);
Directory dir = new Directory(link.path);
Expect.equals(FileSystemEntityType.link, dir.statSync().type);
// Links should be resolved.
Expect.equals(FileSystemEntityType.file, dir.statSync().type);
}
6 changes: 4 additions & 2 deletions LibTest/io/Directory/stat_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ main() async {
}

_main(Directory sandbox) async {
Link link = getTempLinkSync(parent: sandbox);
File file = getTempFileSync(parent: sandbox);
Link link = getTempLinkSync(parent: sandbox, target: file.path);
Directory dir = new Directory(link.path);
asyncStart();
await dir.stat().then((FileStat fs) {
Expect.equals(FileSystemEntityType.link, fs.type);
// Links should be resolved.
Expect.equals(FileSystemEntityType.file, fs.type);
asyncEnd();
});
}
3 changes: 2 additions & 1 deletion LibTest/io/File/statSync_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ main() async {
_main(Directory sandbox) async {
Link link = getTempLinkSync(parent: sandbox);
File file = new File(link.path);
Expect.equals(FileSystemEntityType.link, file.statSync().type);
// Links should be resolved.
Expect.equals(FileSystemEntityType.directory, file.statSync().type);
}
3 changes: 2 additions & 1 deletion LibTest/io/File/stat_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ _main(Directory sandbox) async {
File file = new File(link.path);
asyncStart();
await file.stat().then((FileStat fs) {
Expect.equals(FileSystemEntityType.link, fs.type);
// Links should be resolved.
Expect.equals(FileSystemEntityType.directory, fs.type);
asyncEnd();
});
}
10 changes: 5 additions & 5 deletions LibTest/io/Link/statSync_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
///
/// If the call fails, returns a FileStat object with .type set to
/// FileSystemEntityType.notFound and the other fields invalid.
/// @description Checks that this method synchronously calls the operating
/// system's stat() function
/// @description Checks that this method calls the operating system's stat()
/// function. Test directory
/// @author [email protected]
/// @issue 24821

import "dart:io";
import "../../../Utils/expect.dart";
Expand All @@ -24,6 +23,7 @@ main() async {
}

_main(Directory sandbox) async {
Link link = getTempLinkSync(parent: sandbox);
Expect.equals(FileSystemEntityType.link, link.statSync().type);
Directory dir = getTempDirectorySync(parent: sandbox);
Link link = new Link(dir.path);
Expect.equals(FileSystemEntityType.directory, link.statSync().type);
}
8 changes: 4 additions & 4 deletions LibTest/io/Link/statSync_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// If the call fails, returns a FileStat object with .type set to
/// FileSystemEntityType.notFound and the other fields invalid.
/// @description Checks that this method calls the operating system's stat()
/// function. Test directory
/// function. Test file
/// @author [email protected]

import "dart:io";
Expand All @@ -23,7 +23,7 @@ main() async {
}

_main(Directory sandbox) async {
Directory dir = getTempDirectorySync(parent: sandbox);
Link link = new Link(dir.path);
Expect.equals(FileSystemEntityType.directory, link.statSync().type);
File file = getTempFileSync(parent: sandbox);
Link link = new Link(file.path);
Expect.equals(FileSystemEntityType.file, link.statSync().type);
}
29 changes: 0 additions & 29 deletions LibTest/io/Link/statSync_A01_t05.dart

This file was deleted.

13 changes: 4 additions & 9 deletions LibTest/io/Link/stat_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
/// If the call fails, completes the future with a FileStat object with .type set
/// to FileSystemEntityType.notFound and the other fields invalid.
/// @description Checks that this method calls the operating system's stat()
/// function
/// function. Test directory
/// @author [email protected]
/// @issue 24821

import "dart:io";
import "../../../Utils/expect.dart";
Expand All @@ -24,15 +23,11 @@ main() async {
}

_main(Directory sandbox) async {
Link link = getTempLinkSync(parent: sandbox);
Directory dir = getTempDirectorySync(parent: sandbox);
Link link = new Link(dir.path);
asyncStart();
await link.stat().then((FileStat fs) {
if (Platform.isWindows) {
Expect.equals(FileSystemEntityType.link, fs.type);
} else {
Expect.equals(FileSystemEntityType.directory, fs.type);
}
}).then((_) {
Expect.equals(FileSystemEntityType.directory, fs.type);
asyncEnd();
});
}
8 changes: 4 additions & 4 deletions LibTest/io/Link/stat_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// If the call fails, completes the future with a FileStat object with .type set
/// to FileSystemEntityType.notFound and the other fields invalid.
/// @description Checks that this method calls the operating system's stat()
/// function. Test directory
/// function. Test file
/// @author [email protected]

import "dart:io";
Expand All @@ -23,11 +23,11 @@ main() async {
}

_main(Directory sandbox) async {
Directory dir = getTempDirectorySync(parent: sandbox);
Link link = new Link(dir.path);
File file = getTempFileSync(parent: sandbox);
Link link = new Link(file.path);
asyncStart();
await link.stat().then((FileStat fs) {
Expect.equals(FileSystemEntityType.directory, fs.type);
Expect.equals(FileSystemEntityType.file, fs.type);
asyncEnd();
});
}
33 changes: 0 additions & 33 deletions LibTest/io/Link/stat_A01_t05.dart

This file was deleted.