Repository navigation
tests: the date and string functions of COMPUTE against R and the guide's rules - #451
Merged
Merged
Conversation
…de's rules; the numeric examples are our own
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test-only, no engine change. 1371 date, numeric and string values: DATE.DMY, DATE.MDY, DATE.MOYR, DATE.QYR, DATE.WKYR, DATE.YRDAY (excess days roll into the next month, months 1 to 13, invalid arguments system-missing), YRMODA, TIME.HMS, TIME.DAYS, CTIME., XDATE. of eight datetimes, DATEDIFF in every unit and DATESUM with the closest and rollover methods; INDEX, CHAR.INDEX, RINDEX, CHAR.RINDEX with and without a divisor, CHAR.LENGTH, LENGTH, CHAR.MBLEN, MBLEN.BYTE, the pad, substring, trim, REPLACE, STRUNC, STRING and NUMBER functions, with two- and three-byte characters; and a check that a call with the wrong number of arguments is an error. Expected values are R's (as.Date, POSIXlt, regexpr, substr, nchar in characters and bytes, sprintf) with the guide's rules written out where R has none. No defect found. Where two readings fit, the engine's recorded choices stand: SUBSTR, INDEX, RINDEX, LPAD and RPAD count characters (2026-11-12), a DATEDIFF month is complete once the day and time of day are reached, the F format drops the zero before the point.
The review also made the numeric-function test of #449 use our own examples: the first version reused a few of the guide's example values (RND and TRUNC with a multiple, the floating point sum); they are replaced by invented ones, and whole results below 1e15 are now compared exactly. RND and TRUNC near 1e15 are left out on purpose (the fuzz bits grow with the value). Review: low on the worktree, then medium in five rounds (the low level skips test files); round one: the guide's own example dates, times and strings were reused, replaced; later rounds: the F format zero (a recorded choice, noted), exact whole numbers, wrong-arity errors, stale target values; the last round had nits only.