aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMURLBuilderTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-05-06 21:30:09 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-05-06 21:30:09 +0000
commit53247eb0a1bbead66603837c3c71ec38e1244a62 (patch)
tree20e4ed2f59b7fd5899929012deae3d87addfcf8d /Foundation/GTMURLBuilderTest.m
parenta5d6ae8f62622465a2f5f26b8880029793b2c35d (diff)
Fix bug in GTMURLBuilder that doesn't handle url path with escaped characters. E.g. http://www.google.com/path%3AA/path%3AB would become http://www.google.com/path%3AA/path%3AB/path:A/path:B
DELTA=20 (14 added, 3 deleted, 3 changed)
Diffstat (limited to 'Foundation/GTMURLBuilderTest.m')
-rw-r--r--Foundation/GTMURLBuilderTest.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/Foundation/GTMURLBuilderTest.m b/Foundation/GTMURLBuilderTest.m
index f6eb829..4c0f128 100644
--- a/Foundation/GTMURLBuilderTest.m
+++ b/Foundation/GTMURLBuilderTest.m
@@ -37,6 +37,18 @@
STAssertEqualStrings(@"http://google.com:8080/pathA/pathB?param=val",
[URLBuilder URLString], nil);
STAssertEqualStrings(@"val", [URLBuilder valueForParameter:@"param"], nil);
+
+ URLBuilder = [GTMURLBuilder builderWithString:
+ @"http://google.com:8080/path%3AA/pathB?param=val"];
+ STAssertEqualStrings(@"http://google.com:8080/path%3AA/pathB?param=val",
+ [URLBuilder URLString], nil);
+ STAssertEqualStrings(@"val", [URLBuilder valueForParameter:@"param"], nil);
+
+ URLBuilder = [GTMURLBuilder builderWithString:
+ @"http://google.com:8080/pathA/pathB%2F?param=val"];
+ STAssertEqualStrings(@"http://google.com:8080/pathA/pathB%2F?param=val",
+ [URLBuilder URLString], nil);
+ STAssertEqualStrings(@"val", [URLBuilder valueForParameter:@"param"], nil);
}
- (void)testMailToHandling {
@@ -92,6 +104,8 @@
STAssertEqualStrings(@"http://google.com/", [URLBuilder URLString], nil);
URLBuilder = [GTMURLBuilder builderWithString:@"http://google.com/pA/pB"];
STAssertEqualStrings(@"http://google.com/pA/pB", [URLBuilder URLString], nil);
+ URLBuilder = [GTMURLBuilder builderWithString:@"http://google.com/p%3AA/pB"];
+ STAssertEqualStrings(@"http://google.com/p%3AA/pB", [URLBuilder URLString], nil);
}
@end