@@ -24,8 +24,12 @@ final class MediaTypeTests: XCTestCase {
2424
2525 func testInitWithAudioFileExtensions( ) throws {
2626 try XCTSkipIf ( testingOnRosetta ( ) )
27- // Note: "ogg" isn't supported on iOS.
28- let audioFileExtensions = [ " mp3 " , " m4a " , " wav " , " ogg " ]
27+ var audioFileExtensions = [ " mp3 " , " m4a " , " wav " ]
28+ // Note: "ogg" is only supported on iOS 26 and above.
29+ if #available( iOS 26 . 0 , * ) {
30+ audioFileExtensions. append ( " ogg " )
31+ }
32+
2933 audioFileExtensions. forEach { fileExtension in
3034 XCTAssertEqual ( MediaType ( fileExtension: fileExtension) , . audio, " Unexpected media type for file extension: \( fileExtension) " )
3135 }
@@ -41,11 +45,16 @@ final class MediaTypeTests: XCTestCase {
4145
4246 func testInitWithOtherFileExtensions( ) throws {
4347 try XCTSkipIf ( testingOnRosetta ( ) )
44- let presentationFileExtensions = [
48+ var presentationFileExtensions = [
4549 " pdf " , " doc " , " odt " , " xls " , " xlsx " ,
4650 // Video formats that are not supported on iOS
4751 " ogv "
4852 ]
53+
54+ // Note: "ogg" is only supported on iOS 26 and above.
55+ if #unavailable( iOS 26 . 0 ) {
56+ presentationFileExtensions. append ( " ogg " )
57+ }
4958 presentationFileExtensions. forEach { fileExtension in
5059 XCTAssertEqual ( MediaType ( fileExtension: fileExtension) , . other, " Unexpected media type for file extension: \( fileExtension) " )
5160 }
@@ -80,7 +89,11 @@ final class MediaTypeTests: XCTestCase {
8089
8190 func testInitWithAudioMimeType( ) throws {
8291 try XCTSkipIf ( testingOnRosetta ( ) )
83- let audioMimeTypes = [ " audio/midi " , " audio/x-midi " , " audio/mpeg " , " audio/wav " , " audio/ogg " ]
92+ var audioMimeTypes = [ " audio/midi " , " audio/x-midi " , " audio/mpeg " , " audio/wav " ]
93+ // Note: "ogg" is only supported on iOS 26 and above.
94+ if #available( iOS 26 . 0 , * ) {
95+ audioMimeTypes. append ( " audio/ogg " )
96+ }
8497 audioMimeTypes. forEach { mimeType in
8598 XCTAssertEqual ( MediaType ( mimeType: mimeType) , . audio, " Unexpected media type for file extension: \( mimeType) " )
8699 }
@@ -96,14 +109,19 @@ final class MediaTypeTests: XCTestCase {
96109
97110 func testInitWithOtherMimeType( ) throws {
98111 try XCTSkipIf ( testingOnRosetta ( ) )
99- let otherMimeTypes = [
112+ var otherMimeTypes = [
100113 " application/pdf " , " application/msword " , " application/vnd.openxmlformats-officedocument.wordprocessingml.document " ,
101114 " application/vnd.oasis.opendocument.text " , " application/vnd.ms-excel " , " application/vnd.openxmlformats-officedocument.spreadsheetml.sheet " ,
102115 // Video formats that are not supported on iOS
103116 " video/ogg " , " video/mp2t " , " video/webm " ,
104117 // Audio formats that are not supported on iOS
105118 " audio/opus " , " audio/webm "
106119 ]
120+
121+ // Note: "ogg" is only supported on iOS 26 and above.
122+ if #unavailable( iOS 26 . 0 ) {
123+ otherMimeTypes. append ( " audio/ogg " )
124+ }
107125 otherMimeTypes. forEach { mimeType in
108126 XCTAssertEqual ( MediaType ( mimeType: mimeType) , . other, " Unexpected media type for file extension: \( mimeType) " )
109127 }
0 commit comments