Index: tests/OFIRITests.m ================================================================== --- tests/OFIRITests.m +++ tests/OFIRITests.m @@ -336,10 +336,29 @@ - (void)testIRIWithStringFailsWithInvalidFormat { OTAssertThrowsSpecific([OFIRI IRIWithString: @"http"], OFInvalidFormatException); } + +- (void)testIRIByAppendingPathComponent +{ + OTAssertEqualObjects( + [[[OFIRI IRIWithString: @"http://host/path/component"] + IRIByAppendingPathComponent: @"foo/bar"] path], + @"/path/component/foo/bar"); + + OTAssertEqualObjects( + [[[OFIRI IRIWithString: @"http://host/path/component/"] + IRIByAppendingPathComponent: @"foo/bar"] path], + @"/path/component/foo/bar"); + + OTAssertEqualObjects( + [[[OFIRI IRIWithString: @"http://host/path/component/"] + IRIByAppendingPathComponent: @"foo/bar" + isDirectory: true] path], + @"/path/component/foo/bar/"); +} - (void)testIRIByAddingPercentEncodingForUnicodeCharacters { OTAssertEqualObjects( _IRI[10].IRIByAddingPercentEncodingForUnicodeCharacters,