Split out most of the tests in test_functions.cpp.