我从命令行运行swift test
来运行测试用例.以下是测试用例:
import XCTest
@testable import vnk_swift
class KeyMappingTests: XCTestCase {
static var allTests : [(String, (KeyMappingTests) -> () throws -> Void)] {
return [
// ("testExample", testExample),
]
}
func testExample() {
let keyMapping = KeyMapping()
XCTAssertNotNil(keyMapping , "PASS")
}
}
这是输出信息.
如果我go 掉KeyMapping
的用法,一切正常:
func testExample() {
// let keyMapping = KeyMapping()
XCTAssertNotNil(true , "PASS")
}
看起来当我try 使用一个类时出现了问题.How do I fix this?
(I did not use Xcode for this project as I started with 101, the source code for this project is here: 100)