open-i18n/rust-unic

Drop dependency on rustc_test

Closed this issue · 1 comments

Background: rust-lang/rust#43683

Integration tests using rustc_test, although look nicer in the actual test file, aren't that organic (files cannot be just copy-pasted) and can break regularly, because of the changes to rustc internal.

For these kinds of tests, we have an alternate solution which collects failed test cases and throws one panic at the end, if there are any fails, with some useful information which can be catched with a #[should_panic(expected = "... test cases failed! (... passed)")] pattern.

Example: https://github.com/behnam/rust-unic/blob/master/unic/bidi/tests/conformance_tests.rs#L25-L44

This approach also has the benefit that it allows temporary failures for big tests, meaning that you don't have to get everything in perfect shape before you can commit your big test to master. We've been using this for the non-100%-conforming bidi module, enabling gradual improvements over time.

Maybe we should do this for UNIC-0.5. I'll take a look this weekend.