swift-testing
swift-testing copied to clipboard
[WIP] Serialization traits for data dependencies
Experimental .serialized(for:) trait. Example use cases:
import Foundation
@Test(.serialized(for: ProcessInfo.self))
func `HAS_FREEZER environment variable`() {
_ = setenv("HAS_FREEZER", "1", 1)
#expect(FoodTruck.hasFreezer)
_ = setenv("HAS_FREEZER", "0", 1)
#expect(!FoodTruck.hasFreezer)
}
@Test(.serialized(for: *))
func `Uses lots of different state, seriously, just scads of it`() { ... }
Name subject to extreme bikeshedding!
Resolves rdar://135288463.
Checklist:
- [x] Code and documentation should follow the style of the Style Guide.
- [x] If public symbols are renamed or modified, DocC references should be updated.
@swift-ci test
@swift-ci test
@swift-ci test
@swift-ci test
@swift-ci test
@swift-ci test
@swift-ci test
@swift-ci test