Closed bryanforbes closed 4 years ago
Hi Bryan,
Does the following not work for you?
var config = TestScheduler.Configuration.default
config.cancelled = 1000
That works, but then I'm modifying the configuration for all tests instead of just one individual test. In this case, I only want to change it for one test.
As TestScheduler.Configuration
has value semantics (i.e. a basic struct) assigning it to a new var creates a copy of the configuration – the default isn't modified and in fact, can't be, as it's a static let property with value semantics.
I always forget that basic structs use value semantics. Sorry for the momentary lapse in intelligence. The code above works just fine!
I have a test that had quite a few publishes (7, to be exact) and I wanted to change the configuration to cancel at
1000
rather than900
, but I was unable to create my own configuration because of the following build error:I believe this will require an explicit
init()
marked withpublic
forTestScheduler.Configuration
.