command_which_is_run &&
cat >expect <<-\EOF ?!UNCLOSED-HEREDOC?! &&
we forget to end the here-doc
command_which_is_gobbled