You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if we could use guards to scope random test parameters.
For instance we could then write the following test:
test bool createDate_withBoundedYearMonthAndDay(int year, int month, int day) =
date.year == year && date.month == month && date.day == day
when
year > 0 && year < 3000 &&
month > 0 && month < 13 &&
day > 0 && day < 29 && // not entirely accurate, but hey ...
date := createDate(year, month, day);
The test runner should recognise when a test was executed successfully because the body of the test passed or if it succeeded because the guard failed. Failed execution attempts because of failure to fulfil the guard should be recorded separately from the general test execution runs