[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS.

Change-Id: I6328f28fffa35053861cbe00e7eefde95907c5d2
Reviewed-on: https://dart-review.googlesource.com/55323
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Ben Konyi
2018-05-16 01:49:27 +00:00
committed by commit-bot@chromium.org
parent b51f4b7956
commit bcb36247d2
4 changed files with 62 additions and 5 deletions
@@ -17,6 +17,16 @@ Future main() async {
final rawPath = new Uint8List.fromList([182]);
asyncDir = new Directory.fromRawPath(rawPath);
if (Platform.isMacOS || Platform.isIOS) {
try {
await asyncDir.create();
} on FileSystemException catch (e) {
// Macos doesn't support non-UTF-8 paths.
return;
}
fail('Macos should not accept non-UTF-8 paths!');
}
await asyncDir.create();
expect(await asyncDir.exists(), isTrue);
@@ -38,6 +48,16 @@ Future main() async {
final rawPath = new Uint8List.fromList([182]);
syncDir = new Directory.fromRawPath(rawPath);
if (Platform.isMacOS || Platform.isIOS) {
try {
syncDir.createSync();
} on FileSystemException catch (e) {
// Macos doesn't support non-UTF-8 paths.
return;
}
fail('Macos should not accept non-UTF-8 paths!');
}
syncDir.createSync();
expect(syncDir.existsSync(), isTrue);
@@ -17,6 +17,16 @@ Future main() async {
final rawPath = new Uint8List.fromList([182]);
asyncFile = new File.fromRawPath(rawPath);
if (Platform.isMacOS || Platform.isIOS) {
try {
await asyncFile.create();
} on FileSystemException catch (e) {
// Macos doesn't support non-UTF-8 paths.
return;
}
fail('Macos should not accept non-UTF-8 paths!');
}
await asyncFile.create();
expect(await asyncFile.exists(), isTrue);
for (final file in Directory.current.listSync()) {
@@ -38,6 +48,16 @@ Future main() async {
final rawPath = new Uint8List.fromList([182]);
syncFile = new File.fromRawPath(rawPath);
if (Platform.isMacOS || Platform.isIOS) {
try {
syncFile.createSync();
} on FileSystemException catch (e) {
// Macos doesn't support non-UTF-8 paths.
return;
}
fail('Macos should not accept non-UTF-8 paths!');
}
syncFile.createSync();
expect(syncFile.existsSync(), isTrue);
for (final file in Directory.current.listSync()) {
@@ -28,6 +28,17 @@ Future main() async {
final rawName = new Uint8List.fromList(rawPath);
asyncLink = new Link.fromRawPath(rawName);
if (Platform.isMacOS || Platform.isIOS) {
try {
await asyncLink.create(path);
} on FileSystemException catch (e) {
// Macos doesn't support non-UTF-8 paths.
return;
}
// If we don't get an exception, this Macos configuration works properly.
// Continue with the test.
}
asyncLink = await asyncLink.create(path);
expect(await asyncLink.exists(), isTrue);
@@ -65,6 +76,17 @@ Future main() async {
final rawName = new Uint8List.fromList(rawPath);
syncLink = new Link.fromRawPath(rawName);
if (Platform.isMacOS || Platform.isIOS) {
try {
syncLink.createSync(path);
} on FileSystemException catch (e) {
// Macos doesn't support non-UTF-8 paths.
return;
}
// If we don't get an exception, this Macos configuration works properly.
// Continue with the test.
}
syncLink.createSync(path);
expect(syncLink.existsSync(), isTrue);
@@ -46,11 +46,6 @@ io/secure_socket_alpn_test: Skip # Issue 27638
io/secure_socket_test: Skip # Issue 27638
io/socket_upgrade_to_secure_test: Skip # Issue 27638
[ $system == macos ]
io/non_utf8_directory_test: RuntimeError # Macos doesn't support non-UTF8 paths.
io/non_utf8_file_test: RuntimeError # Macos doesn't support non-UTF8 paths.
io/non_utf8_link_test: RuntimeError, Pass # Works on some Macos configurations.
[ $system == windows ]
io/process_sync_test: Pass, Timeout # Issue 24596
io/skipping_dart2js_compilations_test: Skip # Issue 19551.