Copy daniel's tests from his PR