File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
FirebaseStorage/Tests/Integration Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -416,22 +416,15 @@ class StorageResultTests: StorageIntegrationCommon {
416416
417417 // Download URL format is
418418 // "https://firebasestorage.googleapis.com:443/v0/b/{bucket}/o/{path}?alt=media&token={token}"
419- let downloadURLPattern =
420- " ^ https:\\ / \\ /firebasestorage.googleapis.com:443 \\ /v0 \\ /b \\ /[^ \\ /]* \\ /o \\ / " +
421- " ios%2Fpublic%2F1mb \\ ?alt=media&token=[a-z0-9-]*$ "
419+ let downloadURLPrefix =
420+ " https:/ /firebasestorage.googleapis.com:443/v0/b/ios-opensource-samples " +
421+ " .appspot.com/o/ ios%2Fpublic%2F1mb?alt=media&token"
422422
423423 ref. downloadURL { result in
424424 switch result {
425425 case let . success( downloadURL) :
426- do {
427- let testRegex = try NSRegularExpression ( pattern: downloadURLPattern)
428- let urlString = downloadURL. absoluteString
429- XCTAssertEqual ( testRegex. numberOfMatches ( in: urlString,
430- range: NSRange ( location: 0 ,
431- length: urlString. count) ) , 1 )
432- } catch {
433- XCTFail ( " Throw in downloadURL completion block " )
434- }
426+ let urlString = downloadURL. absoluteString
427+ XCTAssertTrue ( urlString. hasPrefix ( downloadURLPrefix) )
435428 case let . failure( error) :
436429 XCTFail ( " Unexpected error \( error) from downloadURL " )
437430 }
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class StorageIntegrationCommon: XCTestCase {
6767 }
6868 for emptyFile in emptyFiles {
6969 let ref = storage. reference ( ) . child ( emptyFile)
70- ref. putData ( data ) { result in
70+ ref. putData ( Data ( ) ) { result in
7171 self . assertResultSuccess ( result)
7272 setupExpectation. fulfill ( )
7373 }
You can’t perform that action at this time.
0 commit comments