Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SwiftyJSON.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
2E4FEFEB19575BE100351305 /* Supporting Files */,
);
name = Tests;
path = Tests/Tes;
path = Tests/SwiftJSONTests;
sourceTree = "<group>";
};
2E4FEFEB19575BE100351305 /* Supporting Files */ = {
Expand Down
9 changes: 6 additions & 3 deletions Tests/SwiftJSONTests/BaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ class BaseTests: XCTestCase {

super.setUp()

// let file = "./Tests/Tes/Tests.json"
// self.testData = try? Data(contentsOf: URL(fileURLWithPath: file))
if let file = Bundle.module.url(forResource: "Tests", withExtension: "json") {
#if SWIFT_PACKAGE
let testBundle = Bundle.module
#else
let testBundle = Bundle(for: BaseTests.self)
#endif
if let file = testBundle.url(forResource: "Tests", withExtension: "json") {
self.testData = try? Data(contentsOf: file)
} else {
XCTFail("Can't find the test JSON file")
Expand Down
7 changes: 6 additions & 1 deletion Tests/SwiftJSONTests/PerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ class PerformanceTests: XCTestCase {
override func setUp() {
super.setUp()

if let file = Bundle.module.url(forResource: "Tests", withExtension: "json") {
#if SWIFT_PACKAGE
let testBundle = Bundle.module
#else
let testBundle = Bundle(for: PerformanceTests.self)
#endif
if let file = testBundle.url(forResource: "Tests", withExtension: "json") {
self.testData = try? Data(contentsOf: file)
} else {
XCTFail("Can't find the test JSON file")
Expand Down
7 changes: 6 additions & 1 deletion Tests/SwiftJSONTests/SequenceTypeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class SequenceTypeTests: XCTestCase {
var testData: Data?

func testJSONFile() {
if let file = Bundle.module.url(forResource: "Tests", withExtension: "json") {
#if SWIFT_PACKAGE
let testBundle = Bundle.module
#else
let testBundle = Bundle(for: SequenceTypeTests.self)
#endif
if let file = testBundle.url(forResource: "Tests", withExtension: "json") {
self.testData = try? Data(contentsOf: file)
guard let json = try? JSON(data: self.testData!) else {
XCTFail("Unable to parse the data")
Expand Down