File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,20 @@ - (void)test35CachePathForKeyWithDotButNoExtension {
227
227
expect ([cachePath pathExtension ]).to .equal (@" " );
228
228
}
229
229
230
+ - (void )test36CachePathForKeyWithURLQueryParams {
231
+ NSString *urlString = @" https://imggen.alicdn.com/3b11cea896a9438329d85abfb07b30a8.jpg?aid=tanx&tid=1166&m=%7B%22i mg_url%22% 3A%22https%3A%2F%2F gma.alicdn.com%2F bao%2F uploaded%2F i4%2F 1695306010722305097%2F TB2S2KjkHtlpuFjSspoXXbcDpXa_%21% 210-saturn_solar.jpg_sum.jpg%22% 2C%22ti tle%22% 3A%22% E6%A 4%8D%E 7%89% A9%E 8%94% B7%E 8%96% 87%E 7%8E%A B%E 7%91% B0%E 8%8A %B1%22% 2C%22p romot_name%22% 3A%22% 22%2C%22i temid%22% 3A%22546038044448% 22%7D &e=cb88dab197bfaa19804f6ec796ca906dab536b88fe6d4475795c7ee661a7ede1&size=640x246" ;
232
+ NSString *cachePath = [[SDImageCache sharedImageCache ] cachePathForKey: urlString inPath: @" " ];
233
+ expect (cachePath).toNot .beNil ();
234
+ expect ([cachePath pathExtension ]).to .equal (@" jpg" );
235
+ }
236
+
237
+ - (void )test37CachePathForKeyWithTooLongExtension {
238
+ NSString *urlString = @" https://imggen.alicdn.com/3b11cea896a9438329d85abfb07b30a8.jpgasaaaaaaaaaaaaaaaaaaaajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjaaaaaaaaaaaaaaaaajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj" ;
239
+ NSString *cachePath = [[SDImageCache sharedImageCache ] cachePathForKey: urlString inPath: @" " ];
240
+ expect (cachePath).toNot .beNil ();
241
+ expect ([cachePath pathExtension ]).to .equal (@" " );
242
+ }
243
+
230
244
- (void )test40InsertionOfImageData {
231
245
XCTestExpectation *expectation = [self expectationWithDescription: @" Insertion of image data works" ];
232
246
You can’t perform that action at this time.
0 commit comments