我如何测试,使用XCTest和REPL swift

Vin*_*ino 5 testing ios read-eval-print-loop swift

有什么方法可以使用XCTest在Swift中测试我的REPL项目吗?

我创建了一个新的目标,OSX Unit Testing Bundle,将目标依赖项配置到我的项目中,并尝试使用

@testable import test
Run Code Online (Sandbox Code Playgroud)

像这样声明这个类:

func testPath() {
    let archiever = Archieves()

}
Run Code Online (Sandbox Code Playgroud)

我可以声明,但在构建和测试时,但我收到以下错误:

Undefined symbols for architecture x86_64:
  "test.Archieves.__allocating_init (test.Archieves.Type)() -> test.Archieves", referenced from:
      testTests.testTests.testPath (testTests.testTests)() -> () in testTests.o
  "type metadata accessor for test.Archieves", referenced from:
      testTests.testTests.testPath (testTests.testTests)() -> () in testTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)