The rules used by dune fmt for adding a newline doesn't take into account the size of the text. So in the following example it gives not a pretty result. It would be better to use a more dynamic box-like approach for example by using the box from Format. The example would then fit on one line.
(with-stdout-to
x
(echo b)
)