mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-06-04 18:24:01 +08:00
fix(test): normalize CRLF in unindent and update ENV section expected output
- normalize \r\n to \n in unindent to handle TTY output from RequireTty tests - add script commands to ======ENV====== expected section in TestEnvOutput
This commit is contained in:
@@ -618,6 +618,13 @@ func TestEnvOutput(t *testing.T) {
|
||||
export ENV_5='test'\'''
|
||||
export ENV_6='test"'
|
||||
export ENV_7='test,!#;?.@$~'\''"'
|
||||
echo "[${ENV_1}]"
|
||||
echo "[${ENV_2}]"
|
||||
echo "[${ENV_3}]"
|
||||
echo "[${ENV_4}]"
|
||||
echo "[${ENV_5}]"
|
||||
echo "[${ENV_6}]"
|
||||
echo "[${ENV_7}]"
|
||||
======END======
|
||||
[test]
|
||||
[test test]
|
||||
@@ -676,6 +683,7 @@ func TestEnvOutput(t *testing.T) {
|
||||
}
|
||||
|
||||
func unindent(text string) string {
|
||||
text = strings.ReplaceAll(text, "\r\n", "\n")
|
||||
return strings.TrimSpace(strings.ReplaceAll(text, "\t", ""))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user