Add tests for split_doc, fix #5