Michael Long
Jun 12, 2024

--

Nice. On thought though, in that a better mechanism for arguments and expectations might be passing a tuple of both.

@Test("Example", arguments: [(1, 2), (2, 3), (3, 4)])

func testExample(arg: (Int, Int)) async throws {

#expect((arg.0 + 1) == arg.1)

}

That groups the argument with the expected response and avoids having to perform a dictionary lookup.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

No responses yet