Add tests around doctype detection