forked from OAuthSwift/OAuthSwift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of url with flags Fix OAuthSwift#454
- Loading branch information
1 parent
5577014
commit 4a2ba34
Showing
10 changed files
with
104 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// URLTests.swift | ||
// OAuthSwiftTests | ||
// | ||
// Created by Eric Marchand on 17/04/2018. | ||
// Copyright © 2018 Dongri Jin. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import XCTest | ||
@testable import OAuthSwift | ||
|
||
class URLTest: XCTestCase { | ||
|
||
func testNoQuery() { | ||
let url = URL(string: "http://localhost/") | ||
var responseParameters = [String: String]() | ||
if let query = url?.query { | ||
responseParameters += query.parametersFromQueryString | ||
} | ||
XCTAssertTrue(responseParameters.isEmpty) | ||
} | ||
func testWithQuery() { | ||
let url = URL(string: "http://localhost/?code=azeaze") | ||
var responseParameters = [String: String]() | ||
if let query = url?.query { | ||
responseParameters += query.parametersFromQueryString | ||
} | ||
XCTAssertFalse(responseParameters.isEmpty) | ||
XCTAssertNotNil(responseParameters["code"]) | ||
} | ||
|
||
func testWithQueryWithFlag() { | ||
let url = URL(string: "http://localhost/?close&code=azeaze") | ||
var responseParameters = [String: String]() | ||
if let query = url?.query { | ||
responseParameters += query.parametersFromQueryString | ||
} | ||
XCTAssertFalse(responseParameters.isEmpty) | ||
XCTAssertNotNil(responseParameters["code"]) | ||
} | ||
|
||
func testWithQueryWithMultipleFlag() { | ||
let url = URL(string: "http://localhost/?close&test&code=azeaze&flag") | ||
var responseParameters = [String: String]() | ||
if let query = url?.query { | ||
responseParameters += query.parametersFromQueryString | ||
} | ||
XCTAssertFalse(responseParameters.isEmpty) | ||
XCTAssertNotNil(responseParameters["code"]) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters