1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-26 09:29:45 +00:00

Merge pull request #846 from MaddTheSane/maddsIIgs

Use url(forResource:... instead of path(forResource:…
This commit is contained in:
Thomas Harte 2020-11-06 09:39:27 -05:00 committed by GitHub
commit 4f9d06d8c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,13 +22,13 @@ class Krom65816Tests: XCTestCase {
func runTest(_ name: String, pcLimit: UInt32? = nil) { func runTest(_ name: String, pcLimit: UInt32? = nil) {
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)