Skip to content

Age oracles - #474

Merged
halcwb merged 4 commits into
informedica:masterfrom
ploeh:age-oracles
Aug 19, 2026
Merged

Age oracles#474
halcwb merged 4 commits into
informedica:masterfrom
ploeh:age-oracles

Conversation

@ploeh

@ploeh ploeh commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Overview

Add 300 test cases covering three Age functions to pin down current behaviour.

Further information

Related to #469 this pull request continues work getting infrastructure in place so that we can safely change the Age type. It uses three F# script files to have FsCheck generate 100 test cases for each. These test cases are then persisted as parametrized tests so that we have good coverage of the three functions, later allowing us to refactor Age.

Divergence from plan

This pull request is, unfortunately, much larger than 200 lines of code, since most of it is auto-generated, and we need to capture enough test cases to have confidence that refactoring is safe.

Verification

dotnet run servertests pass.

Author checklist

Note

An issue and agreed implementation plan are necessary unless either fewer than 25 lines have been changed or only documentation has been changed.

I confirm that these changes:

  • Follow the process described in CONTRIBUTING.md.
  • Make the changes proposed in the linked issue (if applicable): n/a
  • Follow the approach documented in the linked implementation plan (if applicable): n/a
  • Are no more than 200 lines of changed code, ideally 25-100.
  • Are not more complex than necessary.
  • Cannot easily be split in a way that would make reviewing them significantly easier.
  • Follow the guidelines specified in DEVELOPMENT.md.
  • Have been thoroughly tested.
  • Don't introduce new security vulnerabilities.
  • Follow the AI/LLM Usage Policy — LLMs were not given direct write access to .fs source files (except client-side UI code).

AI/Vibe Coding Disclosure

  • Some or all code in this PR is vibe coded (substantially AI-generated). If checked, describe below which parts were AI-generated, which tool was used, and how the code was verified.

I confirm that I have:

  • Added appropriate automated tests.
  • Updated documentation appropriately.
  • Added comments that highlight important changes and add justification, where necessary. (Create the PR as a draft first, add your comments, then mark as ready for review.)

Reviewer checklist

I confirm that:

  • I am confident that the changes work.
  • The changed code meets our guidelines and standards.
  • The new code is not more complex than necessary.
  • I have clearly labelled suggestions as blocking, required but not blocking, or optional (see CONTRIBUTING.md).

@ploeh
ploeh requested a review from halcwb August 19, 2026 20:28
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds 300 persisted oracle cases that pin the current behavior of Age.calcYears, Age.calcMonths, and Age.toString.

  • Adds generated parameterized tests for year and month calculations.
  • Adds localized string-formatting cases across supported languages.
  • Registers the new test module in the shared test project.
  • Includes temporary FsCheck generation scripts, which are excluded from review by repository policy.

Confidence Score: 5/5

The PR appears safe to merge, with the new Age oracle cases correctly registered for automatic test discovery.

The changes are confined to tests and test-generation assets, and the aggregate Age test list is discoverable through its Expecto test attribute.

Important Files Changed

Filename Overview
tests/Informedica.GenPRES.Shared.Tests/AgeTests.fs Adds three automatically discovered Expecto test collections containing 300 persisted Age oracle cases; no actionable issue identified.
tests/Informedica.GenPRES.Shared.Tests/Informedica.GenPRES.Shared.Tests.fsproj Compiles the new Age test module before the test entry point and includes the oracle scripts as non-compiled project files.

Reviews (1): Last reviewed commit: "test: Add tests for Age.toString" | Re-trigger Greptile

@halcwb
halcwb merged commit 2947fa1 into informedica:master Aug 19, 2026
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants