[Without XCTest/swift-testing]: "Best" or otherwise canonical way to test Async code in Swift script?

Mozilla UniFFI's Swift Bindgen test of futures uses DispatchGroup with enter and leave to test async code inside Task.

Would it not be better to use (try) await test() and write one func test() async throws {} method which creates Task and awaits them? Like I've done in this UniFFI Swift Bindgen test?

I guess the DispatchGroup might not play well with cancellation? :thinking:

Or is there another Swift Std Lib (or Foundation?) primitive that can be used when writing Swift code where we have no access to XCTest (nor can add a Swift package dependency)?