I created the new Multiplatform app with Xcode called Tester and then added a super simple class:
class Transaction {
var time = "1"
}
In the Tests_iOS I have this:
import XCTest
@testable import Tester
class Tests_iOS: XCTestCase {
func testExample() throws {
let t = Transaction()
XCTAssertEqual(t.time, "1")
}
}
The app compiles, however when I try to run the tests, compilation fails with this error:
Undefined symbols for architecture arm64:
"type metadata accessor for Tester.Transaction", referenced from:
Tests_iOS.Tests_iOS.testExample() throws -> () in Tests_iOS.o
"Tester.Transaction.__allocating_init() -> Tester.Transaction", referenced from:
Tests_iOS.Tests_iOS.testExample() throws -> () in Tests_iOS.o
ld: symbol(s) not found for architecture arm64
What am I doing wrong? This is on an M1 Mac using Xcode 13.3