Skip to content

feat(expression_domain_testing): Create a testing suite for expression domains#1630

Draft
ca1umac wants to merge 14 commits intomainfrom
domain_of_testing_suite
Draft

feat(expression_domain_testing): Create a testing suite for expression domains#1630
ca1umac wants to merge 14 commits intomainfrom
domain_of_testing_suite

Conversation

@ca1umac
Copy link
Contributor

@ca1umac ca1umac commented Mar 12, 2026

Description

Create a testing framework that will (in the short-term) check the result of expression::domain_of on some expression.
In the longterm (not in this PR), this should extend to support some ac-style algorithm

Related issues

Uses the functions defined in #1624, and will help test #1547

Key changes

  • create a README to explain
  • implement the test case generation

How to test/review

TBC

@conjure-bot
Copy link

conjure-bot bot commented Mar 12, 2026

Documentation Coverage

Report: https://conjure-cp.github.io/conjure-oxide-reports/pr/1630/coverage-docs/index.html

This PR: 43.48% documented, 4.97% with examples (8/70/161)
Main: 43.48% documented, 4.97% with examples (8/70/161)
Delta: docs +0.00 pp, examples +0.00 pp

type ParseFn = fn(&str, Arc<RwLock<Context<'static>>>) -> Result<Model, Box<ParseErrorCollection>>;

/// Runs a test for one model using each configured parser
fn expression_domain_test(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is completely copied from roundtrip testing. With the changes from #1548 , I can see:

  1. get accept env var
  2. get testconfig
  3. maybe clean the test dir
  4. run some test for every parser

as very standard in any testing framework. Should this be generalised?
All you would need to add would be a function pointer to the function signature so that it could run whatever function for each test (e.g. expression_domain_test_inner).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same is also true for the clean_test_dir_for_accept function, except that wouldn't need any modification

@conjure-bot
Copy link

conjure-bot bot commented Mar 12, 2026

Code Coverage

Report: https://conjure-cp.github.io/conjure-oxide-reports/pr/1630/coverage-code/index.html
Diff report: https://conjure-cp.github.io/conjure-oxide-reports/pr/1630/coverage-code/diff-coverage.html

This PR: 73.00% lines (16621/22770)
Diff: 0.00% lines (0/86 measured; 160 changed)
Main: 73.64% lines (16621/22572)
Delta vs main: -0.64 pp

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