Add unit tests for #5