test: add optional throw fn to expectsError
This is mainly a style thing but I think it's pretty nice to add the throwing function directly to common.expectsError
instead of wrapping that into the throw function as it's done most of the time.
I thought I just create this as a example and I only changed a few tests accordingly.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
test