cats-effect
cats-effect copied to clipboard
testkit: add setTime and advanceTo methods to TestControl
Description
Adds binary-compatible methods for setting absolute time in TestControl:
setTime(targetTime): Sets clock to specified absolute timeadvanceTo(targetTime): Alias for setTime with descriptive name
Both methods fail with IllegalArgumentException if target time is before current time.
Fixes the need for absolute time setting in TestControl, complementing the existing incremental advance() methods.
Why This Approach
This addresses the binary compatibility concerns raised in #4506 by adding new methods instead of modifying existing method signatures. Provides the same functionality as the clockStart parameter approach but maintains backward compatibility.
Refs #3309
Hi @armanbilge, @samspills
Please have a look at this when you have some time and guide accordingly. Thank you :blush: