* Test function for split_text, do not use this function in production. */
| 210 | * Test function for split_text, do not use this function in production. |
| 211 | */ |
| 212 | [[maybe_unused]] void test_split_text() { |
| 213 | static const std::filesystem::path dir("documentQA"); |
| 214 | std::string text = file::read_text_file(dir / "testdoc.txt"); |
| 215 | std::vector<std::string> chunks = split_text(text, 50); |
| 216 | std::string to_write = "----------\n"; |
| 217 | for (const std::string& chunk : chunks) { |
| 218 | to_write += chunk + "\n----------\n"; |
| 219 | } |
| 220 | if (to_write.ends_with('\n')) { |
| 221 | to_write.erase(to_write.size() - 1); |
| 222 | } |
| 223 | file::write_text_file(to_write, dir / "test_result.txt"); |
| 224 | } |
| 225 | } // doc |
nothing calls this directly
no test coverage detected