File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ - (NSString *)encodedString:(NSString *)string
143
143
{
144
144
if (![string length ])
145
145
return @" " ;
146
- return [string stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet characterSetWithCharactersInString: @" .:/" ]];
146
+ return [string stringByAddingPercentEncodingWithAllowedCharacters: [[ NSCharacterSet characterSetWithCharactersInString: @" .:/" ] invertedSet ]];
147
147
}
148
148
149
149
- (NSString *)decodedString : (NSString *)string
Original file line number Diff line number Diff line change 8
8
NSString * const PINCacheTestName = @" PINCacheTest" ;
9
9
NSTimeInterval PINCacheTestBlockTimeout = 5.0 ;
10
10
11
+ @interface PINDiskCache ()
12
+
13
+ - (NSString *)encodedString : (NSString *)string ;
14
+
15
+ @end
16
+
11
17
@interface PINCacheTests ()
12
18
@property (strong , nonatomic ) PINCache *cache;
13
19
@end
@@ -62,6 +68,12 @@ - (dispatch_time_t)timeout
62
68
63
69
#pragma mark - Tests -
64
70
71
+ - (void )testDiskCacheStringEncoding
72
+ {
73
+ NSString *string = [self .cache.diskCache encodedString: @" http://www.test.de-<CoolStuff>" ];
74
+ XCTAssertTrue ([string isEqualToString: @" http%3A%2F%2F www%2E test%2E de-<CoolStuff>" ]);
75
+ }
76
+
65
77
- (void )testCoreProperties
66
78
{
67
79
PINCache *cache = [[PINCache alloc ] initWithName: PINCacheTestName];
You can’t perform that action at this time.
0 commit comments