docs(test-files): state the real test-function name rule - #1216
Merged
Conversation
The guide listed `function testRenderAllTestsPassedWhenNotFailedTests { ... }`
as a working example and claimed function names are case-insensitive. Neither
is true: `get_functions_to_run` matches `${prefix}_*`, a literal lowercase
`test_`, so both that name and `TEST_upper` are treated as auxiliary functions.
Nothing warns about it. A file mixing one of those with a real test runs green
with fewer tests than it defines; only a file made entirely of them is caught,
by "No tests found".
Correct the rule, attribute the definition-style freedom to the syntax rather
than the name, warn about the silent skip, and pin the matcher's actual
behaviour with an acceptance test. The matcher is left alone deliberately:
accepting a bare `test` prefix would start collecting helpers like
`testdata_path` as tests.
Closes #1215
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #1215
docs/test-files.mdlistedfunction testRenderAllTestsPassedWhenNotFailedTests { ... }as a working example and stated that test function names are case-insensitive. The matcher requires a literal, lowercasetest_, so a function named either way is never collected — and when the file also holds a real test, the run is green with fewer tests than the user wrote.💡 Changes
--listas the way to checknocasematchtestprefix would start collecting helpers such astestdata_pathas tests