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 {
416
416
417
417
// Download URL format is
418
418
// "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"
422
422
423
423
ref. downloadURL { result in
424
424
switch result {
425
425
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) )
435
428
case let . failure( error) :
436
429
XCTFail ( " Unexpected error \( error) from downloadURL " )
437
430
}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class StorageIntegrationCommon: XCTestCase {
67
67
}
68
68
for emptyFile in emptyFiles {
69
69
let ref = storage. reference ( ) . child ( emptyFile)
70
- ref. putData ( data ) { result in
70
+ ref. putData ( Data ( ) ) { result in
71
71
self . assertResultSuccess ( result)
72
72
setupExpectation. fulfill ( )
73
73
}
You can’t perform that action at this time.
0 commit comments