-
Notifications
You must be signed in to change notification settings - Fork 3k
common_test: empty heading resulting with no heading #10051
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: maint
Are you sure you want to change the base?
Conversation
u3s
commented
Jul 18, 2025
- allow user to actually specify no heading in print output
CT Test Results 2 files 57 suites 1h 15m 23s ⏱️ Results for commit 09ea2f4. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
- allow user to actually specify no heading in print output
7c1381c
to
09ea2f4
Compare
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.
Pull Request Overview
This PR modifies the tc_print
function in Common Test to allow users to specify no heading in print output. When an empty string is provided as the heading, the output will exclude the header and use single line break instead of double.
- Updates heading handling logic to treat empty strings as "no heading" requests
- Changes line break formatting based on whether a heading is present
Comments suppressed due to low confidence (1)
lib/common_test/src/ct_logs.erl:551
- [nitpick] The variable name 'Parts' is somewhat generic. Consider a more descriptive name like 'FormatParts' or 'OutputParts' to clarify its purpose as components of the formatted output string.
Parts =
"" -> [Format, "\n"]; | ||
_ -> [get_header(Heading),Format,"\n\n"] |
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.
The hardcoded line break pattern creates inconsistency. Consider defining constants or using a more systematic approach to handle line break variations, as this logic may need to be maintained consistently across similar formatting functions.
"" -> [Format, "\n"]; | |
_ -> [get_header(Heading),Format,"\n\n"] | |
"" -> [Format, ?LINE_BREAK]; | |
_ -> [get_header(Heading),Format,?LINE_BREAK, ?LINE_BREAK] |
Copilot uses AI. Check for mistakes.