1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Use url(forResource:... instead of path(forResource:… as it cuts down on creating a URL struct.

This commit is contained in:
C.W. Betts 2020-11-05 14:42:39 -07:00
parent 5126163c5d
commit 189a468ad4

View File

@ -26,13 +26,13 @@ class Krom65816Tests: XCTestCase {
func runTest(_ name: String, pcLimit: UInt32?) { func runTest(_ name: String, pcLimit: UInt32?) {
var testData: Data? var testData: Data?
if let filename = Bundle(for: type(of: self)).path(forResource: name, ofType: "sfc") { if let filename = Bundle(for: type(of: self)).url(forResource: name, withExtension: "sfc") {
testData = try? Data(contentsOf: URL(fileURLWithPath: filename)) testData = try? Data(contentsOf: filename)
} }
var testOutput: String? var testOutput: String?
if let filename = Bundle(for: type(of: self)).path(forResource: name + "-trace_compare", ofType: "log") { if let filename = Bundle(for: type(of: self)).url(forResource: name + "-trace_compare", withExtension: "log") {
testOutput = try? String(contentsOf: URL(fileURLWithPath: filename)) testOutput = try? String(contentsOf: filename)
} }
XCTAssertNotNil(testData) XCTAssertNotNil(testData)