Bad indentation when `run-tests-coverage.sh`
KEINOS opened this issue · 1 comments
KEINOS commented
$ ./.github/run-tests-coverage.sh
* Running in regular mode. Use "-v" or "--verbose" option for verbose output.
* Moving current path to: /workspaces/QiiTask
* Current path is: /workspaces/QiiTask
- Static analysys: Scanning all the packages
Success! All Go vet static analysis passed.
- Unit test: Testing all the packages
ok github.com/Qithub-BOT/QiiTask 0.004s coverage: 100.0% of statements
ok github.com/Qithub-BOT/QiiTask/cmdlist 0.009s coverage: 100.0% of statements
ok github.com/Qithub-BOT/QiiTask/cmdsort 0.004s coverage: 100.0% of statements
ok github.com/Qithub-BOT/QiiTask/config 0.093s coverage: 100.0% of statements
--- FAIL: ExampleFmtAsAbout (0.00s)
got:
About:
A longer description that spans multiple
lines and likely
contains examples and usage of using your command.
want:
About:
A longer description that spans multiple
lines and likely
contains examples and usage of using your command.
FAIL
coverage: 100.0% of statements
FAIL github.com/Qithub-BOT/QiiTask/utils 0.004s
FAIL
The above got:
contents and want:
contents contain spaces before each line. But it seems to be trimmed.
KEINOS commented
It is missing the IFS=
to clear the white spaces list.
function indentStdIn() {
indent="\t"
- while read -r line; do
+ while IFS= read -r line; do
echo -e "${indent}${line}"
done
echo
}
- Wrong indent
Hello-Cobra/.github/run-tests-coverage.sh
Lines 23 to 30 in 85c5321
- Right indent
Hello-Cobra/.github/run-tests-merge.sh
Lines 26 to 32 in 85c5321