Repository navigation
Test expressions across modules, fix two error messages - #64
Merged
Merged
Conversation
New test G4MCPLTests/testexpressions: valid expressions of various value types (bool, integer, floating point, string) and invalid ones (syntax errors, unknown variables, domain errors) given to MCPLGen, MCPLWriter (--mcpl), the heat map writer (--heatmap) and the sb_mcplextra_filterfile and sb_mcplextra_filterview commands. The expressions are parsed in the ExprParser libraries, but used in Python modules, so this tests that the ExprParser exceptions can be caught across modules, also on Intel macOS (where type information is compared by address), rather than crashing. Also fix the error message for invalid quantity expressions of the heat map writer (it showed the filter expression), and a typo in the error message for invalid user flag expressions of MCPLWriter. Assisted-by: Claude
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.
Adds the test G4MCPLTests/testexpressions, which gives valid and invalid
expressions to all places in dgcode where users can provide them:
Valid expressions cover bool, integer, floating point and string values.
Invalid expressions cover syntax errors, unknown variables and domain
errors (e.g. division by zero), and must give a clean error message rather
than a crash.
The expressions are parsed in the ExprParser libraries, but the errors are
caught in Python modules. The test therefore checks that the ExprParser
exceptions can be caught across modules, which is what failed on Intel
macOS, where type information is compared by address. The Intel macOS CI
job now runs this test.
The test found two small bugs, which are also fixed:
writer showed the filter expression instead of the quantity expression.
assisted-by: claude