Commit f29901bb authored by Johannes Schriewer's avatar Johannes Schriewer

Refactor non-existent file loading test

parent 6efa65ec
Pipeline #1931 passed with stage
......@@ -203,7 +203,15 @@ class FSTests: XCTestCase {
func testLoadNonexistentFile() {
let p = Path("doesnotexist.file")
let _ = try? File(path: p, mode: .ReadOnly)
do {
let _ = try File(path: p, mode: .ReadOnly)
XCTFail("Should have thrown an error")
} catch SysError.NoSuchEntity(let path) {
XCTAssertNotNil(path)
XCTAssert(p == path!)
} catch {
XCTFail("Wrong error thrown: \(error)")
}
}
}
......
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