Skip to content

Commit

Permalink
fix: use #filePath instead of #file
Browse files Browse the repository at this point in the history
  • Loading branch information
drmohundro committed Aug 16, 2024
1 parent 4a8eda9 commit 3de7d6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions Tests/SWXMLHashTests/LazyWhiteSpaceParsingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ struct LazyWhiteSpaceParsingTests {
init() {
// Put setup code here. This method is called before the invocation of each test method in the class.

// #if SWIFT_PACKAGE
// let path = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("test.xml").path
// #else
// let bundle = Bundle(for: WhiteSpaceParsingTests.self)
// let path = bundle.path(forResource: "test", ofType: "xml")!
// #endif

let path = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("test.xml").path

#if SWIFT_PACKAGE
let path = URL(fileURLWithPath: #filePath).deletingLastPathComponent().appendingPathComponent("test.xml").path
#else
let bundle = Bundle(for: WhiteSpaceParsingTests.self)
let path = bundle.path(forResource: "test", ofType: "xml")!
#endif
// swiftlint:disable:next force_try
let data = try! Data(contentsOf: URL(fileURLWithPath: path))
xml = XMLHash.lazy(data)
Expand Down
2 changes: 1 addition & 1 deletion Tests/SWXMLHashTests/WhiteSpaceParsingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct WhiteSpaceParsingTests {
init() {
// Put setup code here. This method is called before the invocation of each test method in the class.
#if SWIFT_PACKAGE
let path = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("test.xml").path
let path = URL(fileURLWithPath: #filePath).deletingLastPathComponent().appendingPathComponent("test.xml").path
#else
let bundle = Bundle(for: WhiteSpaceParsingTests.self)
let path = bundle.path(forResource: "test", ofType: "xml")!
Expand Down

0 comments on commit 3de7d6a

Please sign in to comment.