PGSSoft / XCTestParametrizedMacro

Swift macro for parametrizing unit test methods
MIT License
123 stars 7 forks source link

Add output parameter as an expected value for a test #5

Closed mkowalski87 closed 10 months ago

mkowalski87 commented 10 months ago

We want to support specifying an expected value in a test so the developer can use XCTAssertEqual function.

So with the following feature, you could write test for simple power function

    @Parametrize(input: [1,2,3], output: [1, 4, 9])
    func testPow2(input n: Int, output result: Int) {
        XCTAssertEqual(pow2(n),result)
    }

and single expansion should look like this

    func testPow2_n_3_result_9() throws {
        let n: Int = 3
        let result: Int = 9
        XCTAssertEqual(pow2(n),result)
    }

Also, unit tests for this are needed

mkowalski87 commented 10 months ago

implemented under #8