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:
2026-02-17 16:08:23 -08:00
parent 337b585ba0
commit 8ec0d6ac41
30 changed files with 1916 additions and 102 deletions

View File

@@ -40,10 +40,9 @@ ErlangHighlighter::ErlangHighlighter()
void
ErlangHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<HighlightSpan> &out) const
{
const auto &rows = buf.Rows();
if (row < 0 || static_cast<std::size_t>(row) >= rows.size())
if (row < 0 || static_cast<std::size_t>(row) >= buf.Nrows())
return;
std::string s = static_cast<std::string>(rows[static_cast<std::size_t>(row)]);
std::string s = buf.GetLineString(static_cast<std::size_t>(row));
int n = static_cast<int>(s.size());
int i = 0;
@@ -156,4 +155,4 @@ ErlangHighlighter::HighlightLine(const Buffer &buf, int row, std::vector<Highlig
++i;
}
}
} // namespace kte
} // namespace kte