AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.03k stars 602 forks source link

Swift package manager version support update #370

Open ios-engineer opened 3 months ago

ios-engineer commented 3 months ago

Checklist

Description

Added Swift Package Manager support for the 5.7.1, 5.8, and 5.9 toolchains

Motivation and Context

When using open source in certain settings, teams must leverage pipelines to not only build apps, but also meet scanning requirements using a variety of tools. This requires being able to generate dependency graphs for projects that do not check in package.resolved files. Resolving dependency graphs are simplified by using the Swift Package Manager toolchain so packages should target broad support of different versions (especially latest)

Due to the simple transient dependency chain of OHHTTPStubs (no dependencies), support only requires having multiple package.swift files - making the return on investment high.

Evidence Of Test: [24/24] Linking OHHTTPStubsPackageTests Build complete! (16.39s) Test Suite 'All tests' started at 2024-05-09 14:44:08.049. Test Suite 'OHHTTPStubsPackageTests.xctest' started at 2024-05-09 14:44:08.050. Test Suite 'HTTPStubsPathHelpersTests' started at 2024-05-09 14:44:08.050. Test Case '-[HTTPStubsPathHelpersTests testOHResourceBundle]' started. Test Case '-[HTTPStubsPathHelpersTests testOHResourceBundle]' passed (0.000 seconds). Test Suite 'HTTPStubsPathHelpersTests' passed at 2024-05-09 14:44:08.051. Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds Test Suite 'NSURLConnectionDelegateTests' started at 2024-05-09 14:44:08.051. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnection_cancel]' started. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnection_cancel]' passed (2.078 seconds). Test Case '-[NSURLConnectionDelegateTests test_NSURLConnection_cookies]' started. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnection_cookies]' passed (0.107 seconds). Test Case '-[NSURLConnectionDelegateTests test_NSURLConnection_redirected]' started. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnection_redirected]' passed (0.731 seconds). Test Case '-[NSURLConnectionDelegateTests test_NSURLConnectionDelegate_error]' started. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnectionDelegate_error]' passed (0.519 seconds). Test Case '-[NSURLConnectionDelegateTests test_NSURLConnectionDelegate_multiple_choices]' started. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnectionDelegate_multiple_choices]' passed (0.622 seconds). Test Case '-[NSURLConnectionDelegateTests test_NSURLConnectionDelegate_success]' started. Test Case '-[NSURLConnectionDelegateTests test_NSURLConnectionDelegate_success]' passed (0.625 seconds). Test Suite 'NSURLConnectionDelegateTests' passed at 2024-05-09 14:44:12.733. Executed 6 tests, with 0 failures (0 unexpected) in 4.682 (4.683) seconds Test Suite 'NSURLConnectionTests' started at 2024-05-09 14:44:12.734. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendAsyncronousRequest_mainQueue]' started. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendAsyncronousRequest_mainQueue]' passed (0.638 seconds). Test Case '-[NSURLConnectionTests test_NSURLConnection_sendAsyncronousRequest_parallelQueue]' started. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendAsyncronousRequest_parallelQueue]' passed (0.624 seconds). Test Case '-[NSURLConnectionTests test_NSURLConnection_sendMultipleAsyncronousRequests_mainQueue]' started. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendMultipleAsyncronousRequests_mainQueue]' passed (1.741 seconds). Test Case '-[NSURLConnectionTests test_NSURLConnection_sendMultipleAsyncronousRequests_parallelQueue]' started. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendMultipleAsyncronousRequests_parallelQueue]' passed (1.742 seconds). Test Case '-[NSURLConnectionTests test_NSURLConnection_sendSyncronousRequest_mainQueue]' started. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendSyncronousRequest_mainQueue]' passed (0.642 seconds). Test Case '-[NSURLConnectionTests test_NSURLConnection_sendSyncronousRequest_parallelQueue]' started. Test Case '-[NSURLConnectionTests test_NSURLConnection_sendSyncronousRequest_parallelQueue]' passed (0.621 seconds). Test Suite 'NSURLConnectionTests' passed at 2024-05-09 14:44:18.742. Executed 6 tests, with 0 failures (0 unexpected) in 6.007 (6.008) seconds Test Suite 'NSURLSessionTests' started at 2024-05-09 14:44:18.742. Test Case '-[NSURLSessionTests test_NSURLSession_DataTask_DelegateMethods]' started. Test Case '-[NSURLSessionTests test_NSURLSession_DataTask_DelegateMethods]' passed (0.521 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionCustomHTTPBody]' started. Test Case '-[NSURLSessionTests test_NSURLSessionCustomHTTPBody]' passed (0.207 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig]' started. Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig]' passed (0.518 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_Disabled]' started. Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_Disabled]' passed (0.002 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_HeaderRetentionPolicyOnRedirect]' started. Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_HeaderRetentionPolicyOnRedirect]' passed (0.021 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_MethodAndDataRetentionOnRedirect]' started. Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_MethodAndDataRetentionOnRedirect]' passed (0.020 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_notFollowingRedirects]' started. Test Case '-[NSURLSessionTests test_NSURLSessionDefaultConfig_notFollowingRedirects]' passed (0.210 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionEphemeralConfig]' started. Test Case '-[NSURLSessionTests test_NSURLSessionEphemeralConfig]' passed (0.513 seconds). Test Case '-[NSURLSessionTests test_NSURLSessionNativeHTTPBody]' started. Test Case '-[NSURLSessionTests test_NSURLSessionNativeHTTPBody]' passed (0.001 seconds). Test Case '-[NSURLSessionTests test_SharedNSURLSession]' started. 2024-05-09 14:44:21.274 xctest[79124:963706] [NSURLSession sharedSession] may not be invalidated Test Case '-[NSURLSessionTests test_SharedNSURLSession]' passed (0.519 seconds). Test Suite 'NSURLSessionTests' passed at 2024-05-09 14:44:21.276. Executed 10 tests, with 0 failures (0 unexpected) in 2.532 (2.533) seconds Test Suite 'NilValuesTests' started at 2024-05-09 14:44:21.276. Test Case '-[NilValuesTests test_EmptyData]' started. Test Case '-[NilValuesTests test_EmptyData]' passed (0.025 seconds). Test Case '-[NilValuesTests test_EmptyFile]' started. 2024-05-09 14:44:21.302 xctest[79124:963735] -[HTTPStubsResponse initWithFileURL:statusCode:headers:]: nil file path. Returning empty data Test Case '-[NilValuesTests test_EmptyFile]' passed (0.027 seconds). Test Case '-[NilValuesTests test_EmptyFileWithURL]' started. 2024-05-09 14:44:21.329 xctest[79124:963735] -[HTTPStubsResponse initWithFileURL:statusCode:headers:]: nil file path. Returning empty data Test Case '-[NilValuesTests test_EmptyFileWithURL]' passed (0.027 seconds). Test Case '-[NilValuesTests test_InvalidPath]' started. 2024-05-09 14:44:21.356 xctest[79124:963706] Assertion failure in -[HTTPStubsResponse initWithFileURL:statusCode:headers:], HTTPStubsResponse.m:176 Test Case '-[NilValuesTests test_InvalidPath]' passed (0.012 seconds). Test Case '-[NilValuesTests test_InvalidPathWithURL]' started. 2024-05-09 14:44:21.369 xctest[79124:963706] Assertion failure in -[HTTPStubsResponse initWithFileURL:statusCode:headers:], HTTPStubsResponse.m:176 Test Case '-[NilValuesTests test_InvalidPathWithURL]' passed (0.004 seconds). Test Case '-[NilValuesTests test_NilData]' started. Test Case '-[NilValuesTests test_NilData]' passed (0.001 seconds). Test Case '-[NilValuesTests test_NilPath]' started. 2024-05-09 14:44:21.373 xctest[79124:963735] -[HTTPStubsResponse initWithFileURL:statusCode:headers:]: nil file path. Returning empty data Test Case '-[NilValuesTests test_NilPath]' passed (0.024 seconds). Test Case '-[NilValuesTests test_NilPathWithURL]' started. 2024-05-09 14:44:21.397 xctest[79124:963735] -[HTTPStubsResponse initWithFileURL:statusCode:headers:]: nil file path. Returning empty data Test Case '-[NilValuesTests test_NilPathWithURL]' passed (0.025 seconds). Test Case '-[NilValuesTests test_NilURLAndCookieHandlingDisabled]' started. Test Case '-[NilValuesTests test_NilURLAndCookieHandlingDisabled]' passed (0.001 seconds). Test Case '-[NilValuesTests test_NilURLAndCookieHandlingEnabled]' started. Test Case '-[NilValuesTests test_NilURLAndCookieHandlingEnabled]' passed (0.001 seconds). Test Case '-[NilValuesTests test_NonFileURL]' started. 2024-05-09 14:44:21.423 xctest[79124:963706] *** Assertion failure in -[HTTPStubsResponse initWithFileURL:statusCode:headers:], HTTPStubsResponse.m:166 Test Case '-[NilValuesTests test_NonFileURL]' passed (0.000 seconds). Test Suite 'NilValuesTests' passed at 2024-05-09 14:44:21.424. Executed 11 tests, with 0 failures (0 unexpected) in 0.147 (0.148) seconds Test Suite 'SwiftHelpersTests' started at 2024-05-09 14:44:21.424. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests test_ohhttpStubs_httpBody]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests test_ohhttpStubs_httpBody]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testAndOperator]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testAndOperator]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testContainsQueryParams]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testContainsQueryParams]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasFormBodyIsFalse]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasFormBodyIsFalse]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasFormBodyIsTrue]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasFormBodyIsTrue]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasHeaderNamedIsFalse]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasHeaderNamedIsFalse]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasHeaderNamedIsTrue]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasHeaderNamedIsTrue]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasJsonBodyIsFalse]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasJsonBodyIsFalse]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasJsonBodyIsTrue]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHasJsonBodyIsTrue]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHeaderValueForKeyEqualsDoesNotExist]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHeaderValueForKeyEqualsDoesNotExist]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHeaderValueForKeyEqualsIsFalse]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHeaderValueForKeyEqualsIsFalse]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHeaderValueForKeyEqualsIsTrue]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHeaderValueForKeyEqualsIsTrue]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHTTPMethod]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testHTTPMethod]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsAbsoluteURLString]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsAbsoluteURLString]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsExtension]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsExtension]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsHost]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsHost]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsPath_absoluteURL]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsPath_absoluteURL]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsPath_relativeURL]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsPath_relativeURL]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsScheme]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testIsScheme]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testNotOperator]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testNotOperator]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testOrOperator]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testOrOperator]' passed (0.000 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathEndsWith]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathEndsWith]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathMatches_casensensitive]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathMatches_casensensitive]' passed (0.003 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathMatches_caseSensitive]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathMatches_caseSensitive]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathStartsWith_absoluteURL]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathStartsWith_absoluteURL]' passed (0.001 seconds). Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathStartsWith_relativeURL]' started. Test Case '-[OHHTTPStubsSwiftTests.SwiftHelpersTests testPathStartsWith_relativeURL]' passed (0.001 seconds). Test Suite 'SwiftHelpersTests' passed at 2024-05-09 14:44:21.443. Executed 26 tests, with 0 failures (0 unexpected) in 0.018 (0.019) seconds Test Suite 'TimingTests' started at 2024-05-09 14:44:21.443. Test Case '-[TimingTests test_LongData_RequestTime1_ResponseTime5]' started. Test Case '-[TimingTests test_LongData_RequestTime1_ResponseTime5]' passed (6.280 seconds). Test Case '-[TimingTests test_RequestTime0_ResponseTime0]' started. Test Case '-[TimingTests test_RequestTime0_ResponseTime0]' passed (0.015 seconds). Test Case '-[TimingTests test_RequestTime1_ResponseTime0]' started. Test Case '-[TimingTests test_RequestTime1_ResponseTime0]' passed (1.049 seconds). Test Case '-[TimingTests test_SmallDataLargeTime_CumulativeAlgorithm]' started. Test Case '-[TimingTests test_SmallDataLargeTime_CumulativeAlgorithm]' passed (6.000 seconds). Test Case '-[TimingTests test_VeryLongData_RequestTime1_ResponseTime0]' started. Test Case '-[TimingTests test_VeryLongData_RequestTime1_ResponseTime0]' passed (1.042 seconds). Test Suite 'TimingTests' passed at 2024-05-09 14:44:35.830. Executed 5 tests, with 0 failures (0 unexpected) in 14.386 (14.387) seconds Test Suite 'WithContentsOfURLTests' started at 2024-05-09 14:44:35.830. Test Case '-[WithContentsOfURLTests test_NSData_dataWithContentsOfURL_mainQueue]' started. Test Case '-[WithContentsOfURLTests test_NSData_dataWithContentsOfURL_mainQueue]' passed (0.641 seconds). Test Case '-[WithContentsOfURLTests test_NSData_dataWithContentsOfURL_parallelQueue]' started. Test Case '-[WithContentsOfURLTests test_NSData_dataWithContentsOfURL_parallelQueue]' passed (0.638 seconds). Test Case '-[WithContentsOfURLTests test_NSString_stringWithContentsOfURL_mainQueue]' started. Test Case '-[WithContentsOfURLTests test_NSString_stringWithContentsOfURL_mainQueue]' passed (0.641 seconds). Test Case '-[WithContentsOfURLTests test_NSString_stringWithContentsOfURL_parallelQueue]' started. Test Case '-[WithContentsOfURLTests test_NSString_stringWithContentsOfURL_parallelQueue]' passed (0.622 seconds). Test Suite 'WithContentsOfURLTests' passed at 2024-05-09 14:44:38.372. Executed 4 tests, with 0 failures (0 unexpected) in 2.541 (2.542) seconds Test Suite 'OHHTTPStubsPackageTests.xctest' passed at 2024-05-09 14:44:38.373. Executed 69 tests, with 0 failures (0 unexpected) in 30.313 (30.322) seconds Test Suite 'All tests' passed at 2024-05-09 14:44:38.373. Executed 69 tests, with 0 failures (0 unexpected) in 30.313 (30.324) seconds URL: foo/bar/baz#anchor -> Path: Optional("foo/bar/baz") URL: scheme: -> Path: Optional("") URL: scheme://host/foo/bar/baz -> Path: Optional("/foo/bar/baz") URL: scheme://host/foo/bar/baz;param -> Path: Optional("/foo/bar/baz;param") URL: scheme://host/path#/foo/bar/baz -> Path: Optional("/path") URL: scheme://host/path?/foo/bar/baz -> Path: Optional("/path") URL: scheme://host/path;/foo/bar/baz -> Path: Optional("/path;/foo/bar/baz") URL: foo/bar/baz?q=1 -> Path: Optional("foo/bar/baz") URL: foo/bar/baz/wizz -> Path: Optional("foo/bar/baz/wizz") URL: scheme://host/foo/bar -> Path: Optional("/foo/bar") URL: path?/foo/bar/baz -> Path: Optional("path") URL: foo/bar/baz -> Path: Optional("foo/bar/baz") URL: path#/foo/bar/baz -> Path: Optional("path") URL: scheme://foo/bar/baz -> Path: Optional("/bar/baz") URL: scheme://host/foo/bar/baz/wizz -> Path: Optional("/foo/bar/baz/wizz") URL: scheme:// -> Path: Optional("") URL: scheme://host/foo/bar/baz?q=1 -> Path: Optional("/foo/bar/baz") URL: scheme://host/foo/bar/baz#anchor -> Path: Optional("/foo/bar/baz") URL: path;/foo/bar/baz -> Path: Optional("path;/foo/bar/baz") URL: foo/bar/baz;param -> Path: Optional("foo/bar/baz;param") URL: path?/foo/bar/baz -> Path: Optional("path") URL: path;/foo/bar/baz -> Path: Optional("path;/foo/bar/baz") URL: scheme://foo/bar/baz -> Path: Optional("/bar/baz") URL: scheme://host/foo/bar -> Path: Optional("/foo/bar") URL: scheme://host/foo/bar/baz -> Path: Optional("/foo/bar/baz") URL: foo/bar/baz;param -> Path: Optional("foo/bar/baz;param") URL: scheme://host/path;/foo/bar/baz -> Path: Optional("/path;/foo/bar/baz") URL: scheme: -> Path: Optional("") URL: scheme:// -> Path: Optional("") URL: scheme://host/foo/bar/baz#anchor -> Path: Optional("/foo/bar/baz") URL: scheme://host/path#/foo/bar/baz -> Path: Optional("/path") URL: scheme://host/foo/bar/baz/wizz -> Path: Optional("/foo/bar/baz/wizz") URL: foo/bar/baz -> Path: Optional("foo/bar/baz") URL: foo/bar/baz?q=1 -> Path: Optional("foo/bar/baz") URL: scheme://host/foo/bar/baz?q=1 -> Path: Optional("/foo/bar/baz") URL: scheme://host/path?/foo/bar/baz -> Path: Optional("/path") URL: foo/bar/baz/wizz -> Path: Optional("foo/bar/baz/wizz") URL: scheme://host/foo/bar/baz;param -> Path: Optional("/foo/bar/baz;param") URL: path#/foo/bar/baz -> Path: Optional("path") URL: foo/bar/baz#anchor -> Path: Optional("foo/bar/baz") URL: path/foo/bar/baz -> Path: Optional("path/foo/bar/baz") URL: scheme://host/path?/foo/bar -> Path: Optional("/path") URL: scheme://host/foo/bar -> Path: Optional("/foo/bar") URL: scheme://host/foo/bar/baz -> Path: Optional("/foo/bar/baz") URL: scheme://host/foo/bar;param -> Path: Optional("/foo/bar;param") URL: foo/bar?q=1 -> Path: Optional("foo/bar") URL: scheme: -> Path: Optional("") URL: scheme:// -> Path: Optional("") URL: path;/foo/bar -> Path: Optional("path;/foo/bar") URL: scheme://host/path/foo/bar/baz -> Path: Optional("/path/foo/bar/baz") URL: foo/bar;param -> Path: Optional("foo/bar;param") URL: path#/foo/bar -> Path: Optional("path") URL: scheme://foo/bar/baz -> Path: Optional("/bar/baz") URL: scheme://host/foo/bar#anchor -> Path: Optional("/foo/bar") URL: path?/foo/bar -> Path: Optional("path") URL: scheme://host/path;/foo/bar -> Path: Optional("/path;/foo/bar") URL: foo/bar -> Path: Optional("foo/bar") URL: scheme://host/foo/bar?q=1 -> Path: Optional("/foo/bar") URL: foo/bar#anchor -> Path: Optional("foo/bar") URL: foo/bar/baz -> Path: Optional("foo/bar/baz") URL: scheme://host/path#/foo/bar -> Path: Optional("/path") URL: scheme://host/foo/bar/12/baz;param -> Path: Optional("/foo/bar/12/baz;param") URL: scheme://foo/bar/12/baz -> Path: Optional("/bar/12/baz") URL: scheme://host/foo/bAr/12/baZ#anchor -> Path: Optional("/foo/bAr/12/baZ") URL: scheme://host/foo/bar/12/baz#anchor -> Path: Optional("/foo/bar/12/baz") URL: scheme://host/foo/bAr/12/baZ;param -> Path: Optional("/foo/bAr/12/baZ;param") URL: scheme://host/path#/foo/bAr/12/baZ -> Path: Optional("/path") URL: scheme://host/path/foo/bar/12/baz -> Path: Optional("/path/foo/bar/12/baz") URL: scheme://host/path;/foo/ bAr/12/baZ -> Path: Optional("/path;/foo/bAr/12/baZ") URL: scheme://host/path?/foo/bar/12/baz -> Path: Optional("/path") URL: scheme://host/path?/foo/bAr/12/baZ -> Path: Optional("/path") URL: scheme://host/foo/bAr/12/baZ?q=1 -> Path: Optional("/foo/bAr/12/baZ") URL: scheme://host/path/foo/bAr/12/baZ -> Path: Optional("/path/foo/bAr/12/baZ") URL: scheme://host/foo/bar/12/baz?q=1 -> Path: Optional("/foo/bar/12/baz") URL: scheme://host/foo/bar/12 -> Path: Optional("/foo/bar/12") URL: scheme://host/path;/foo/bar/12/baz -> Path: Optional("/path;/foo/bar/12/baz") URL: scheme://host/path#/foo/bar/12/baz -> Path: Optional("/path") URL: scheme://host/foo/bAr/12/baZ?q=1 -> Path: Optional("/foo/bAr/12/baZ") URL: scheme://host/foo/bar/12/baz?q=1 -> Path: Optional("/foo/bar/12/baz") URL: scheme://host/path;/foo/bar/12/baz -> Path: Optional("/path;/foo/bar/12/baz") URL: scheme://host/path#/foo/bAr/12/baZ -> Path: Optional("/path") URL: scheme://foo/bar/12/baz -> Path: Optional("/bar/12/baz") URL: scheme://host/foo/bar/12 -> Path: Optional("/foo/bar/12") URL: scheme://host/path?/foo/bAr/12/baZ -> Path: Optional("/path") URL: scheme://host/path/foo/bar/12/baz -> Path: Optional("/path/foo/bar/12/baz") URL: scheme://host/path;/foo/bAr/12/baZ -> Path: Optional("/path;/foo/bAr/12/baZ") URL: scheme://host/foo/bar/12/baz;param -> Path: Optional("/foo/bar/12/baz;param") URL: scheme://host/foo/bar/12/baz#anchor -> Path: Optional("/foo/bar/12/baz") URL: scheme://host/path?/foo/bar/12/baz -> Path: Optional("/path") URL: scheme://host/foo/bAr/12/baZ#anchor -> Path: Optional("/foo/bAr/12/baZ") URL: scheme://host/foo/bAr/12/baZ;param -> Path: Optional("/foo/bAr/12/baZ;param") URL: scheme://host/path/foo/bAr/12/baZ -> Path: Optional("/path/foo/bAr/12/baZ") URL: scheme://host/path#/foo/bar/12/baz -> Path: Optional("/path") URL: scheme://host/path;/foo/bar/baz -> Path: Optional("/path;/foo/bar/baz") URL: scheme://host/foo/bar/baz -> Path: Optional("/foo/bar/baz") URL: scheme://host/path?/foo/bar/baz -> Path: Optional("/path") URL: path/foo/bar/baz -> Path: Optional("path/foo/bar/baz") URL: scheme://host/foo/bar#anchor -> Path: Optional("/foo/bar") URL: scheme:// -> Path: Optional("") URL: scheme://host/foo/bar;param -> Path: Optional("/foo/bar;param") URL: foo/bar?q=1 -> Path: Optional("foo/bar") URL: scheme://host/foo/bar -> Path: Optional("/foo/bar") URL: scheme://host/path/foo/bar/baz -> Path: Optional("/path/foo/bar/baz") URL: foo/bar;param -> Path: Optional("foo/bar;param") URL: foo/bar/baz -> Path: Optional("foo/bar/baz") URL: foo/bar -> Path: Optional("foo/bar") URL: path#/foo/bar/baz -> Path: Optional("path") URL: path?/foo/bar/baz -> Path: Optional("path") URL: path;/foo/bar/baz -> Path: Optional("path;/foo/bar/baz") URL: scheme://host/foo/bar?q=1 -> Path: Optional("/foo/bar") URL: foo/bar#anchor -> Path: Optional("foo/bar") URL: scheme://foo/bar/baz -> Path: Optional("/bar/baz") URL: scheme://host/path#/foo/bar/baz -> Path: Optional("/path") URL: scheme: -> Path: Optional("") URL: scheme://host/path;/foo/bar/baz -> Path: Optional("/path;/foo/bar/baz") URL: scheme://host/foo/bar/baz -> Path: Optional("/foo/bar/baz") URL: scheme://host/path?/foo/bar/baz -> Path: Optional("/path") URL: path/foo/bar/baz -> Path: Optional("path/foo/bar/baz") URL: scheme://host/foo/bar#anchor -> Path: Optional("/foo/bar") URL: scheme:// -> Path: Optional("") URL: scheme://host/foo/bar;param -> Path: Optional("/foo/bar;param") URL: foo/bar?q=1 -> Path: Optional("foo/bar") URL: scheme://host/foo/bar -> Path: Optional("/foo/bar") URL: scheme://host/path/foo/bar/baz -> Path: Optional("/path/foo/bar/baz") URL: foo/bar;param -> Path: Optional("foo/bar;param") URL: foo/bar/baz -> Path: Optional("foo/bar/baz") URL: foo/bar -> Path: Optional("foo/bar") URL: path#/foo/bar/baz -> Path: Optional("path") URL: path?/foo/bar/baz -> Path: Optional("path") URL: path;/foo/bar/baz -> Path: Optional("path;/foo/bar/baz") URL: scheme://host/foo/bar?q=1 -> Path: Optional("/foo/bar") URL: foo/bar#anchor -> Path: Optional("foo/bar") URL: scheme://foo/bar/baz -> Path: Optional("/bar/baz") URL: scheme://host/path#/foo/bar/baz -> Path: Optional("/path") URL: scheme: -> Path: Optional("")