-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
For all languages the InlineExpectationsTest documentation is misleading regarding the .expected file:
Provides a library for writing QL tests whose success or failure is based on expected results embedded in the test source code as comments, rather than a
.expectedfile.
To me that sounds like I can omit the .expected file, but that is not actually the case. When no .expected file is present CodeQL CLI will consider the test to fail because apparently expects some (arbitrary?) result:
0 tests passed; 1 tests failed:
FAILED: path/to/test.qlfailed: path/to/test.ql
Query produced no results.
Therefore it would be good to:
- Improve the
InlineExpectationsTestdocumentation by mentioning that an empty.expectedfile is needed - Improve CodeQL CLI to inform the user in the test output that no
.expectedfile was found and therefore the expects the test query to yield some (arbitrary?) results
Or it should be verified, what result CodeQL CLI is actually expecting when no .expected file is present; the CodeQL CLI documentation is also not specific regarding this.