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

Update tests for the physics package and update code #1202

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Feb 4, 2025

This PR updates the pyhsics tests, and adjusts the PhysicsMethods.ts file:

  • Lines 286-289 are never reached because on line 245, if arg is true and next is not an open brace, an error is thrown. So to get this far, we know arg is false or next is an open brace. Since 28 checks for arg being true, that would only occur if next is an open brace. But in that case, the condition for line 271 will be true, and that block ends with a return. So lines 287-288 can never be reached.
  • In original line 714, starKet can only be true if hasKet is true, but the if at original line 707 means that hasKet must be false for line 714, and so starKet is false, and the || starKet is superfluous.
  • Lines 1046-1049 are not needed. This is because endI is the string index for the character that follows the argument found by the GetArgument() call on original line 1032, and because original line 1028 guarantees that the argument starts with a brace, this means that endI is after the closing brace. Note that parser.i changes in the loop only by the GetUpTo() on line 1040 succeeds, and that only happens when it finds a ,. that would put parser.i just after that, so it is at most pointing to the closing brace, and endI is after that, so parser.i is never greater-than-or-equal-to endI on line 1046. So I removed that block.

@dpvc dpvc requested a review from zorkow February 4, 2025 21:26
@dpvc dpvc added this to the v4.0 milestone Feb 4, 2025
Base automatically changed from update-test-framework to develop February 25, 2025 20:55
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

@dpvc dpvc merged commit 638f529 into develop Feb 26, 2025
@dpvc dpvc deleted the test-physics branch February 26, 2025 23:15
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