Post

Replies

Boosts

Views

Activity

Reply to Parameterized testing with ‘any’ values
@DTS Engineer Thanks for explaining what was wrong with the first part! import Testing protocol ChartDataPoint { } struct BodyFatPoint: ChartDataPoint { } struct ActiveCaloriesPoint: ChartDataPoint { } struct Tests { let expectedBodyFatValues: [Double] = [1.0, 2.0, 3.0] let expectedActiveEnergyValues: [Double] = [1.0, 2.0, 3.0] @Test(arguments: [ (expectedBodyFatValues, BodyFatPoint.self as any ChartDataPoint.Type), (expectedActiveEnergyValues, ActiveCaloriesPoint.self as any ChartDataPoint.Type) ]) func healthKitDataReading( expectedData: [Double], dataChartType: any ChartDataPoint.Type ) async throws { } } I want to use a variable in place of the double array. I’m using 365 values, and with 4 tuples of parameters, it’s a lot to see in the parameters.
Jul ’24