diff --git a/tests/standalone_2/io/non_utf8_directory_test.dart b/tests/standalone_2/io/non_utf8_directory_test.dart index b4dd23f6dad..7bce332c165 100644 --- a/tests/standalone_2/io/non_utf8_directory_test.dart +++ b/tests/standalone_2/io/non_utf8_directory_test.dart @@ -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); diff --git a/tests/standalone_2/io/non_utf8_file_test.dart b/tests/standalone_2/io/non_utf8_file_test.dart index 4d93c25a24c..96f114e1de9 100644 --- a/tests/standalone_2/io/non_utf8_file_test.dart +++ b/tests/standalone_2/io/non_utf8_file_test.dart @@ -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()) { diff --git a/tests/standalone_2/io/non_utf8_link_test.dart b/tests/standalone_2/io/non_utf8_link_test.dart index b39d82dc8b7..8901ff54e58 100644 --- a/tests/standalone_2/io/non_utf8_link_test.dart +++ b/tests/standalone_2/io/non_utf8_link_test.dart @@ -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); diff --git a/tests/standalone_2/standalone_2_vm.status b/tests/standalone_2/standalone_2_vm.status index 8f5862ff708..4b95f11a2cb 100644 --- a/tests/standalone_2/standalone_2_vm.status +++ b/tests/standalone_2/standalone_2_vm.status @@ -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.