-
Notifications
You must be signed in to change notification settings - Fork 187
Fix Loop contains which contained a missing negation and add test cases. #156
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
base: master
Are you sure you want to change the base?
Conversation
Add the action and set up an initial configuration that passes on the codebase at this point in time.
Invalid Go toolchain version (1 result) * go.mod#L0C0:0: As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version). `1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.
(with comments on what the hash is representing
I couldn't find a better resource than https://github.com/dependabot/dependabot-core/blob/main/github_actions/spec/fixtures/workflow_files/pinned_sources_version_comments.yml to document what formats work.
Add some helpers to shape index cell and range iterator to match C++. Update loop to use the helpers to more closely match the code flows. Negate a boolean check that was missed. TODO: test cases to prove it works now but not before the fix.
@@ -1332,6 +1357,18 @@ func TestLoopRelations(t *testing.T) { | |||
contains: true, | |||
sharedEdge: true, | |||
}, | |||
// https://github.com/golang/geo/issues/77 and 78 | |||
// These cases failed prior to this fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment ("this fix" means the pull request, not the file). I'd suggest a different comment. Something like:
// Cases below here prevent regressions of bugs which previously appeared in the golang version
// and which are missing test coverage in the C++ codebase.
// containsCenterMatches reports if the clippedShapes containsCenter boolean | ||
// corresponds to the crossing target type given. (This is to work around C++ | ||
// allowing false == 0, true == 1 type implicit conversions and comparisons) | ||
func containsCenterMatches(a bool, target crossingTarget) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make a
type *rangeIterator
? That way you can ensure that the boolean means what you intend it to mean. Alternatively, consider renaming a
to containsCenter
.
return true | ||
} | ||
// Otherwise test all the edge crossings directly. | ||
aClipped := ai.it.IndexCell().shapes[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use your new ai/bi.clipped() function?
Loop's hasCrossingRelation() had the wrong condition on one branch. This has been resolved and test cases added ensuring it was fixed.
Fix #77
Fix #78