Testing https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary using:
Parity 1.11.1 testnet (parity --no-persistent-txqueue --chain dev)
Ruby 2.4.2p198 on Windows 10, using the Ethereum.rb gem
Note that the number of requests handled by the Parity node was less than 100 per second, which limits the extent of testing possible.
Code review: no issues identified
Testing: all tests passed, no errors were found
Functions exhaustively tested from 1970 to 2286:
- _isLeapYear
- _getDaysInMonth
- _daysFromDate
- timestampFromDate
Function exhaustively tested from 1970-01-01 to 2298-07-20:
- _daysToDate
Random time points between 1970-01-01 (0) and 2298-07-20 (10_000_000_000).
- timestampToDate
- timestamp_to_date_time
- isLeapYear
- isWeekDay
- isWeekEnd
- getDaysInMonth
- getDayOfWeek
- getYear
- getMonth
- getDay
- getHour
- getMinute
- getSecond
First pass: checked each function 200_000 times
Random time points between 1970-01-01 (0) and 2298-07-20 (10_000_000_000).
- diffYears
- diffMonths
- diffDays
- diffHours
- diffMinutes
- diffSeconds
First pass: checked each function 200_000 times
Random DateTime points between 1970-01-01 and 2299-12-31 23:59:59
- timestampFromDateTime
First pass: checked 120_000 times
Adding to / subtracting from random time points between 1970-01-01 (0) and 2298-07-20 (10_000_000_000).
Adding / subtracting time periods of approximately 0-299 years
- addYears
- addMonths
- addDays
- addHours
- addMinutes
- addSeconds
- subYears
- subMonths
- subDays
- subHours
- subMinutes
- subSeconds
First pass: checked each function 100_000 times
Note: also checking that subtractions resulting in a date before 1970-01-01 00:00:00