All Projects → keygx → PAssert

keygx / PAssert

Licence: MIT license
Power Assert inspired debug tool in Swift

Programming Languages

swift
15916 projects

PAssert

Power Assert inspired Test tool for XCTest by Swift

Requirements

  • Swift 4.0
  • iOS 8.4 or later

Installation

To integrate "PAssert.swift" into your Xcode project Test Target

Usage

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

License

PAssert is released under the MIT license. See LICENSE for details.

Author

Yukihiko Kagiyama (keygx) https://twitter.com/keygx

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].