PGSSoft / XCTestParametrizedMacro

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

Array of tuple object as an argument in macro #15

Open mkowalski87 opened 9 months ago

mkowalski87 commented 9 months ago

As an enhancement, we could introduce an option to pass an array of tuples as an argument to the macro. This syntax would make it easier to discern which input corresponds to the output.

with input and output

@Parametrize(arguments: [
(input1, output1),
(input2, output2),
(input3, output3)
])
func testMethod(input n: I, output o: O) {

}

without output but with labels

@Parametrize(arguments: [
(input1, "label1"),
(input2, "label2"),
(input3, "label3")
])
func testMethod(input n: I) {

}

with input, output and labels

@Parametrize(arguments: [
(input1, output1, "label1"),
(input2, output2, "label2"),
(input3, output3, "label3")
])
func testMethod(input n: I, output o: O) {

}