better tests for extract_document