Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 315 Bytes

swift-playground-unit-test.md

File metadata and controls

18 lines (12 loc) · 315 Bytes

Swift playground unit test

  1. Create a unit test
import Foundation
import XCTest


public class UnitTests: XCTestCase {

    func testFindIndex() {
        XCTAssertEqual(Test.printFindIndexResult(" ", ""), "Position: N/A")
    }
}
  1. In swift playground run UnitTests.defaultTestSuite.run()