Factored out tests.