Cargo How to Display Print in Test Command

Oct 28, 2018 • One minute to read

Table of contents

Sometime you try to understand why an assertion failed. It can be many things and you need some visibility to understand what’s wrong with your code.

By default cargo test prevent every print. To display it you just need to use this:

$ cargo test -- --nocapture

Enjoy

rustcargo
comments powered by Disqus