[pve-devel] [PATCH installer v2 11/17] auto-installer: tests: replace manual panic!() with assert_eq!()

Christoph Heiss c.heiss at proxmox.com
Tue Jul 23 13:37:07 CEST 2024


On Tue, Jul 23, 2024 at 01:04:06PM GMT, Aaron Lauterer wrote:
>
> I quickly compared both variants and realized again, that with the panic, we
> can pretty debug print the structs, making it quite a bit easier to compare
> the expected result to the actual one.

Yep, that's right. Seems I've missed that.

>
> With the output we get from `assert_eq` it can be very cumbersome to
> actually see the diff and why the test failed since the data structures can
> be quite large.
>
> Instead of hacking or own pretty print, we could maybe think about using
> https://crates.io/crates/pretty_assertions

As discussed offline, I think that this is definitely the way to go.
Especially when keeping in mind that these tests are going to grow with
~every auto-installer feature.




More information about the pve-devel mailing list