Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add roundtrip test functions skipping comparison with FlatTerm-decoded #4866

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

teodanciu
Copy link
Contributor

@teodanciu teodanciu commented Feb 1, 2025

Description

This is an attempt to allow for more relaxed cbor roundtrip checks, namely: optionally skipping the comparison of the initial value with the value obtained by decoding the FlatTerm. For types that are memoized, this check doesn't succeed (and it's also already skipped roundtrip functions for Annotator types) .
Since we'll have DecCBOR instances for types for which atm we only have DecCBOR (Annotator) instances (memoized), if we can't skip this check, then we can't have roundtrip checks for them.

PR is a draft, and missing comments and changelog entries, because it's just a proposal - I'm not too happy about polluting the Roundtrip space with another dimension.
I would be happy to implement a more elegant solution, or maybe better names.

Checklist

  • Commits in meaningful sequence and with useful messages
  • Tests added or updated when needed
  • CHANGELOG.md files updated for packages with externally visible changes

    New section is never added with the code changes. (See RELEASING.md)
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary

    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Code formatted (use scripts/fourmolize.sh)
  • Cabal files formatted (use scripts/cabal-format.sh)
  • hie.yaml updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

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.

1 participant