-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit tests for CharacterSet and URL
- Loading branch information
Showing
4 changed files
with
80 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// CharacterSetTests.swift | ||
// Alexandria | ||
// | ||
// Created by Jonathan Landon on 10/26/16. | ||
// | ||
// | ||
|
||
import XCTest | ||
|
||
class CharacterSetTests: XCTestCase { | ||
|
||
func testStringLiteralInitializer() { | ||
let set: CharacterSet = "abcdefg" | ||
|
||
XCTAssert(set.contains("a"), "Character missing from set") | ||
XCTAssert(set.contains("d"), "Character missing from set") | ||
XCTAssert(!set.contains("h"), "Character should not be in set") | ||
} | ||
|
||
} |
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,31 @@ | ||
// | ||
// URLTests.swift | ||
// Alexandria | ||
// | ||
// Created by Jonathan Landon on 10/26/16. | ||
// | ||
// | ||
|
||
import XCTest | ||
import Alexandria | ||
|
||
class URLTests: XCTestCase { | ||
|
||
func testStringLiteralInitializer() { | ||
let url: URL = "https://github.com/ovenbits" | ||
|
||
XCTAssert(url.absoluteString == "https://github.com/ovenbits", "Absolute strings are not equal") | ||
XCTAssert(url.scheme == "https", "Scheme are not equal") | ||
XCTAssert(url.host == "github.com", "Hosts are not equal") | ||
XCTAssert(url.path == "/ovenbits", "Paths are not equal") | ||
} | ||
|
||
func testPathAppendingOperator() { | ||
var url: URL = "https://github.com" | ||
url = url + "ovenbits" | ||
url = url + "Alexandria" | ||
|
||
XCTAssert(url.path == "/ovenbits/Alexandria", "Paths are not equal") | ||
} | ||
|
||
} |
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