XCTestParametrizedMacro
XCTestParametrizedMacro copied to clipboard
Array of tuple object as an argument in macro
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) {
}