Add benchmarks, migration tests, and dev guide
Add benchmarks for core operations, migration edge case tests, improved buffer I/O tests, and developer guide - Introduced `test_benchmarks.cc` for performance benchmarking of key operations in `PieceTable` and `Buffer`, including syntax highlighting and iteration patterns. - Added `test_migration_coverage.cc` to provide comprehensive tests for migration of `Buffer::Rows()` to `PieceTable` APIs, with edge cases, boundary handling, and consistency checks. - Enhanced `test_buffer_io.cc` with additional cases for save/load workflows, file handling, and better integration with the core API. - Documented architectural details and core concepts in a new `DEVELOPER_GUIDE.md`. Highlighted design principles, code organization, and contribution workflows.
This commit is contained in:
@@ -82,7 +82,7 @@ HighlighterEngine::GetLine(const Buffer &buf, int row, std::uint64_t buf_version
|
||||
// Only use cached state if it's for the current version and row still exists
|
||||
if (r <= row - 1 && kv.second.version == buf_version) {
|
||||
// Validate that the cached row index is still valid in the buffer
|
||||
if (r >= 0 && static_cast<std::size_t>(r) < buf.Rows().size()) {
|
||||
if (r >= 0 && static_cast<std::size_t>(r) < buf.Nrows()) {
|
||||
if (r > best)
|
||||
best = r;
|
||||
}
|
||||
@@ -221,4 +221,4 @@ HighlighterEngine::PrefetchViewport(const Buffer &buf, int first_row, int row_co
|
||||
ensure_worker_started();
|
||||
cv_.notify_one();
|
||||
}
|
||||
} // namespace kte
|
||||
} // namespace kte
|
||||
Reference in New Issue
Block a user