Power Assert inspired Test tool for XCTest by Swift
- Swift 4.0
- iOS 8.4 or later
To integrate "PAssert.swift" into your Xcode project Test Target
Example Test Code
import UIKit
import XCTest
class PAssertSampleTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
// Test MyCalc add()
func testCalc() {
let calc = MyCalc()
PAssert(calc.add(3, 4), ==, 7)
}
}
Test failure
=== Assertion Failed =============================================
DATE: 2015-08-04 21:04:52
FILE: PAssertSampleTests.swift
LINE: 29
FUNC: testCalc()
=> PAssert(calc.add(3, 4), ==, 7)
| | |
| | 7
| |
| false
|
12
PAssert is released under the MIT license. See LICENSE for details.
Yukihiko Kagiyama (keygx) https://twitter.com/keygx