# Multi-line output should work fine.
command
command arg
---
Command { name: "command", args: [], prefix: None, tags: {}, silent: false, fail: false, line_number: 2 }
Command { name: "command", args: [Argument { key: None, value: "arg" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 3 }
# Output that contains empty lines should automatically be prefixed with >.
# This should be the case for empty lines at the start and end of the output,
# as well as multiple empty lines.
_set prefix="\n"
command id=1
command id=2
---
>
> Command { name: "command", args: [Argument { key: Some("id"), value: "1" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 12 }
>
> Command { name: "command", args: [Argument { key: Some("id"), value: "2" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 13 }
_set prefix="" suffix="\n\n"
command id=1
command id=2
---
> Command { name: "command", args: [Argument { key: Some("id"), value: "1" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 21 }
>
> Command { name: "command", args: [Argument { key: Some("id"), value: "2" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 22 }
>
_set prefix="\n" suffix="\n\n"
command id=1
command id=2
---
>
> Command { name: "command", args: [Argument { key: Some("id"), value: "1" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 30 }
>
>
> Command { name: "command", args: [Argument { key: Some("id"), value: "2" }], prefix: None, tags: {}, silent: false, fail: false, line_number: 31 }
>
# Empty output blocks should default to "ok", but only once, and only if none of
# the commands produce any output. This includes the start_block and end_block
# handlers.
_set prefix="" suffix=""
---
ok
(command)
(command)
(command)
---
ok
(command)
command
(command)
---
Command { name: "command", args: [], prefix: None, tags: {}, silent: false, fail: false, line_number: 54 }
_set start_block="" end_block="end"
---
end
_set start_block="" end_block=""
---
ok
# Prefixes should handle empty output and output ending with a newline properly.
prefix: _echo ""
---
ok
prefix: _echo "\n"
---
prefix:
prefix: _echo "\n\n"
---
prefix:
prefix:
# Lines only containing whitespace are not considered empty, and not prefixed.
# The output parser also handles them correctly when parsing this file.
_set prefix= suffix=
_echo " "
_echo " "
_echo "\t"
---