Below you will find pages that utilize the taxonomy term “Ergonomic”
Postsread more
Swift Testing: an ergonomic combination helper
This helper is installable with SPM, see GitHub repo
I’ve been using the Swift Testing
framework more. Despite my
previous grumble I do like the arguments:
feature of the @Test
macro and how much it can clean up tests:
@Test(arguments: [
(true, "bob", 38),
(false, "sue", 45)
])
func testUserPermissions(isBasketEmpty: Bool, username: String, age: Int) {
#expect( ... )
}
The ability to supply a list of parameter variants to test is very useful. I think it tends to result in more exhaustive tests because of ease of use.
But being able to do easily whack in a list of argument variants soon reveals a slight annoyance. It’s not unusual to end up with a test like this: