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 .expected file.
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.ql
failed: path/to/test.ql
Query produced no results.
Therefore it would be good to:
- Improve the
InlineExpectationsTest documentation by mentioning that an empty .expected file is needed
- Improve CodeQL CLI to inform the user in the test output that no
.expected file 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.
For all languages the
InlineExpectationsTestdocumentation is misleading regarding the.expectedfile:To me that sounds like I can omit the
.expectedfile, but that is not actually the case. When no.expectedfile is present CodeQL CLI will consider the test to fail because apparently expects some (arbitrary?) result:Therefore it would be good to:
InlineExpectationsTestdocumentation by mentioning that an empty.expectedfile is needed.expectedfile was found and therefore the expects the test query to yield some (arbitrary?) resultsOr it should be verified, what result CodeQL CLI is actually expecting when no
.expectedfile is present; the CodeQL CLI documentation is also not specific regarding this.