Skip to content

Conversation

@jmag722
Copy link

@jmag722 jmag722 commented Dec 5, 2025

Adding assertClose method to UnitTest, for comparing real/complex scalars and arrays against an expected value.

… array types, using overloaded proc. Attempted simple test. UnitTests (AssertClose, AssertEquals, AssertTrue) failing with:

$CHPL_HOME/modules/packages/UnitTest.chpl:203: internal error: unsupported case in resolveTypeAlias [resolution/functionResolution.cpp:10430]
> Note: This source location is a guess.
… error, but getting rid of invalid where clause (ruling that out), adding void return type
…ng point! making params param proc fixed issue. relax exact domain matching in the future
…ut different indexing allowed,add additional tests. withinTol made generic. fixed printing for complex numbers
@jmag722
Copy link
Author

jmag722 commented Dec 5, 2025

@e-kayrakli I still need to rebase, but wanted your feedback on current progress so far, especially whether or not this is following best practices.

Logic-wise though, I required array shapes to match as assertEqual throws an error for that, figured we could stay consistent for now? Or we could allow 1D and multidimensional array comparisons if sizes match? Can't think of an application for that but let me know. Also, I throw a generic Error for mismatched shapes, should I create my own Error subclass?

Probably need more thorough tests/better documentation too.

@e-kayrakli
Copy link
Contributor

Thanks @jmag722! On a quick look the direction looks right to me.

Just a few procedural caveats:

  • I am working on something else (among other core devs) with a deadline on Monday, so, I'd rather give a more detailed feedback after I am past that.
  • In case you missed it, we are preparing for the 2.7 release, which is due to come out in about ~2 weeks. As part of that, we have already frozen main for adding new features (working on bug fixes and doc updates for one more week or so). So, even if we can get the PR ready to merge, we can't merge it until we un-freeze main, which probably won't happen next week.

We can still work on the PR and I can test and help you test it next week. If we agree that it is ready to go, we can add a post-release label to it and I can merge it in once the release dust settles. In which case, this feature will be in version 2.8 due roughly in 3 months.

@e-kayrakli e-kayrakli self-assigned this Dec 5, 2025
@e-kayrakli e-kayrakli self-requested a review December 5, 2025 15:18
@jmag722
Copy link
Author

jmag722 commented Dec 5, 2025

Thanks! Oh good to know. There's no rush on this, we can talk more next week.

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