File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class RequestTests: XCTestCase {
33
33
super. tearDown ( )
34
34
}
35
35
36
- func testURLQueryParameterEncoding ( ) {
36
+ func testJapanesesURLQueryParameterEncoding ( ) {
37
37
OHHTTPStubs . stubRequestsPassingTest ( { request in
38
38
XCTAssert ( request. URL? . query == " q=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF " )
39
39
return true
@@ -50,4 +50,22 @@ class RequestTests: XCTestCase {
50
50
51
51
waitForExpectationsWithTimeout ( 1.0 , handler: nil )
52
52
}
53
+
54
+ func testSymbolURLQueryParameterEncoding( ) {
55
+ OHHTTPStubs . stubRequestsPassingTest ( { request in
56
+ XCTAssert ( request. URL? . query == " q=%21%22%23%24%25%26%27%28%290%3D~%7C%60%7B%7D%2A%2B%3C%3E%3F_ " )
57
+ return true
58
+ } , withStubResponse: { request in
59
+ return OHHTTPStubsResponse ( data: NSData ( ) , statusCode: 200 , headers: nil )
60
+ } )
61
+
62
+ let request = SearchRequest ( query: " ! \" #$%&'()0=~|`{}*+<>?_ " )
63
+ let expectation = expectationWithDescription ( " waiting for the response. " )
64
+
65
+ API . sendRequest ( request) { result in
66
+ expectation. fulfill ( )
67
+ }
68
+
69
+ waitForExpectationsWithTimeout ( 1.0 , handler: nil )
70
+ }
53
71
}
You can’t perform that action at this time.
0 commit comments