I actually think that it's cleaner to have the unit tests for each function after the respective function rather than merging them like this, but this is technically more efficient and removes some code duplication. So, while this isn't what I'd have done, I guess that it's up to you.

In any case, please fix the spacing on the assert and static asserts in this section. All of the previous ones had no space after the assert, whereas all of these new ones do have a space. So, please make the new ones match the rest of the module and not have the extraneous space.

Other than that, LGTM.