@@ -2,14 +2,6 @@ import Foundation
22import XCTest
33@testable import APIKit
44
5- #if !swift(>=4.0)
6- extension NSTextCheckingResult {
7- fileprivate func range( at idx: Int ) -> NSRange {
8- return rangeAt ( idx)
9- }
10- }
11- #endif
12-
135class MultipartFormDataParametersTests : XCTestCase {
146 // MARK: Entity
157 func testDataEntitySuccess( ) {
@@ -32,7 +24,7 @@ class MultipartFormDataParametersTests: XCTestCase {
3224
3325 let pattern = " ^multipart/form-data; boundary=([ \\ w.]+)$ "
3426 let regexp = try NSRegularExpression ( pattern: pattern, options: [ ] )
35- let range = NSRange ( location: 0 , length: parameters. contentType. characters . count)
27+ let range = NSRange ( location: 0 , length: parameters. contentType. count)
3628 let match = regexp. matches ( in: parameters. contentType, options: [ ] , range: range)
3729 XCTAssertTrue ( match. count > 0 )
3830
@@ -65,7 +57,7 @@ class MultipartFormDataParametersTests: XCTestCase {
6557
6658 let pattern = " ^multipart/form-data; boundary=([ \\ w.]+)$ "
6759 let regexp = try NSRegularExpression ( pattern: pattern, options: [ ] )
68- let range = NSRange ( location: 0 , length: parameters. contentType. characters . count)
60+ let range = NSRange ( location: 0 , length: parameters. contentType. count)
6961 let match = regexp. matches ( in: parameters. contentType, options: [ ] , range: range)
7062 XCTAssertTrue ( match. count > 0 )
7163
@@ -100,7 +92,7 @@ class MultipartFormDataParametersTests: XCTestCase {
10092
10193 let pattern = " ^multipart/form-data; boundary=([ \\ w.]+)$ "
10294 let regexp = try NSRegularExpression ( pattern: pattern, options: [ ] )
103- let range = NSRange ( location: 0 , length: parameters. contentType. characters . count)
95+ let range = NSRange ( location: 0 , length: parameters. contentType. count)
10496 let match = regexp. matches ( in: parameters. contentType, options: [ ] , range: range)
10597 XCTAssertTrue ( match. count > 0 )
10698
0 commit comments