Commit 07afd11e authored by Drew's avatar Drew

Update to swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a

Random changes to optionals
parent 79d1549a
Pipeline #1933 passed with stage
......@@ -164,9 +164,12 @@ public struct Path {
/// that's not available
public static func homeDirectory() -> Path? {
let home = getenv("HOME")
if let s = String(validatingUTF8: home) {
return Path(s)
if let h = home {
if let s = String(validatingUTF8: h) {
return Path(s)
}
}
return nil
}
......
......@@ -152,7 +152,14 @@ public class Log {
}
}
let out = (self.logTarget == .StdOut) ? stdout : stderr
#if os(Linux)
let os_stdout = stdout!
let os_stderr = stderr!
#else
let os_stdout = stdout
let os_stderr = stderr
#endif
let out = (self.logTarget == .StdOut) ? os_stdout : os_stderr
if self.logFileAndLine {
self._fwrite(out, "\(date.isoDateString!) [\(level)] \(file):\(line): ")
} else {
......
......@@ -27,7 +27,7 @@ class URLTests: XCTestCase {
}
func testURLParse1() {
let url = URL(string: "http://google.com/")
let url = atfoundation.URL(string: "http://google.com/")
XCTAssert(url.schema == "http")
XCTAssert(url.domain == "google.com", url.domain)
XCTAssert(url.path.description == "/")
......@@ -36,7 +36,7 @@ class URLTests: XCTestCase {
}
func testURLParse2() {
let url = URL(string: "https://user:password@example.com/path/here?parameter=value%20here#fragment")
let url = atfoundation.URL(string: "https://user:password@example.com/path/here?parameter=value%20here#fragment")
XCTAssert(url.schema == "https")
XCTAssert(url.domain == "example.com", url.domain)
XCTAssert(url.fragment == "fragment", "\(url.fragment)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment