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
Shared: Inline test expectations #11778
Conversation
- remove from identical-files
- remove from identical-files
- remove from identical-files
- remove from identical-files
- remove from identical-files
- add util shared pack to ql - remove from identical-files
- remove from identical-files
- add util shared pack to swift - remove from identical-files
|
I had an idea of how to simplify the signature even further: We could make a That way the signature just becomes a single I've implemented it as a PR against this PR here: yoff#37 |
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.
When expanding some of the individual files in the "Files changed" view I still see some QL-for-QL warnings, e.g., on line 16 of the new cpp/ql/test/TestUtilities/InlineExpectationsTest.qll. Those should probably be resolved.
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.
Java mostly LGTM, with a small suggestion:
| GoodExpectation() { getKnownFailure() = "" } | ||
| } | ||
| private class XmlExpectationComment extends ExpectationComment instanceof J::XmlComment { | ||
| override string getContents() { result = this.(J::XmlComment).getText().trim() } |
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.
| override string getContents() { result = this.(J::XmlComment).getText().trim() } | |
| override string getContents() { result = super.getText().trim() } |
| class FalsePositiveExpectation extends ValidExpectation { | ||
| FalsePositiveExpectation() { getKnownFailure() = "SPURIOUS" } | ||
| } | ||
| override Location getLocation() { result = this.(J::XmlComment).getLocation() } |
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.
| override Location getLocation() { result = this.(J::XmlComment).getLocation() } | |
| override Location getLocation() { result = J::XmlComment.super.getLocation() } |
| FalseNegativeExpectation() { getKnownFailure() = "MISSING" } | ||
| } | ||
| override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) { | ||
| this.(J::XmlComment).hasLocationInfo(path, sl, sc, el, ec) |
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.
| this.(J::XmlComment).hasLocationInfo(path, sl, sc, el, ec) | |
| J::XmlComment.super.hasLocationInfo(path, sl, sc, el, ec) |
| string expectation; | ||
|
|
||
| InvalidExpectation() { this = TInvalidExpectation(comment, expectation) } | ||
| override string toString() { result = this.(J::XmlComment).toString() } |
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.
| override string toString() { result = this.(J::XmlComment).toString() } | |
| override string toString() { result = J::XmlComment.super.toString() } |
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.
|
@erik-krogh nice, I agree we might prefer that.. |
inline Location into the shared implementation of InlineExpectationsTest
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.
| "ql/ql/test/TestUtilities/InlineExpectationsTest.qll", | ||
| "go/ql/test/TestUtilities/InlineExpectationsTest.qll", | ||
| "swift/ql/test/TestUtilities/InlineExpectationsTest.qll" | ||
| ], |
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.
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.
Friday win for sure.
|
Unfortunately we do have to assume a |
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.
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
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.
Java
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.
C# LGTM!
Very nice application of param modules!!!
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.
Python
Moves the inline test implementation to a shared module.