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

fix: use a global replace to join multiple line Vensim equations in comments #175

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

ToddFincannon
Copy link
Collaborator

@ToddFincannon ToddFincannon commented Mar 19, 2022

Fixes #174

@chrispcampbell chrispcampbell changed the title use a global replace to join multiple line Vensim equations in comments fix: use a global replace to join multiple line Vensim equations in comments Mar 21, 2022
Copy link
Contributor

@chrispcampbell chrispcampbell left a comment

Choose a reason for hiding this comment

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

@ToddFincannon: The fix looks harmless, but could you please add a test case for this? I tried quickly adding one myself but wasn't able to reproduce since I wasn't sure which part of that example equation is triggering the issue. (Like, is it the length of the entire equation, or the multiple backslash continuations, or a combination?)

@ToddFincannon
Copy link
Collaborator Author

@chrispcampbell: I didn't include a test case because I believed the change to be simple enough that it was not required. Any input with a single newline will give the same result that we had before. I tried extracting the long equation from EPS that triggered this bug, but it pulled in so many other things, that it would take a long time to get a valid equation. I can say that this change fixed the EPS problem in situ. I prefer not to take the effort to construct another test case.

@chrispcampbell
Copy link
Contributor

@ToddFincannon: OK, understood. I just wanted to make sure we have an independent test case on hand for changes like this to ensure coverage for refactoring work I'd like to get to someday. I was able to build an isolated test case (see longeqns, included in this branch) using the EPS equation you included in the issue. The names weren't important, just the structure (and line break locations) of the equation, so it ended up being pretty quick to add. I'll merge this PR shortly.

@chrispcampbell chrispcampbell merged commit 678f2bb into develop Apr 4, 2022
@chrispcampbell chrispcampbell deleted the todd/174-bad-comments branch April 4, 2022 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Equations with more than two lines result in bad comments
2 participants