diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-11 18:17:22 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-11 18:17:22 -0500 |
| commit | 837183e3a49ba955b79c0b854e8eb6034b248fa3 (patch) | |
| tree | 4cfd2b0d794b72c025883eace8cc1878723742cc | |
| parent | 54d376712c63e0ed947f7368cfead8d95f8a3f21 (diff) | |
| download | dotemacs-837183e3a49ba955b79c0b854e8eb6034b248fa3.tar.gz dotemacs-837183e3a49ba955b79c0b854e8eb6034b248fa3.zip | |
docs: clarify the coverage-exclude and token-seed comments
The Makefile's `COVERAGE_EXCLUDE' comment said why `test-all-comp-errors.el' is excluded but not why `test-lorem-optimum-benchmark.el' is. It now notes that undercover's instrumentation slows execution enough to fail the benchmark's wall-clock assertions. And `cj/markov-generate' now has a comment explaining why `tokens' is seeded reversed (`(list w2 w1)'): the list is built with `push' and `nreverse'd at the end, so without the note the reversed seed reads like a bug at a glance.
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | modules/lorem-optimum.el | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -228,8 +228,9 @@ COVERAGE_DIR = .coverage COVERAGE_FILE = $(COVERAGE_DIR)/simplecov.json # Test files that can't coexist with undercover's instrumentation -# (e.g. test-all-comp-errors byte-compiles modules, which fails on -# instrumented sources). Excluded from `make coverage' only. +# (test-all-comp-errors byte-compiles modules, which fails on instrumented +# sources; test-lorem-optimum-benchmark's wall-clock assertions fail when +# instrumentation slows execution). Excluded from `make coverage' only. COVERAGE_EXCLUDE = \ $(TEST_DIR)/test-all-comp-errors.el \ $(TEST_DIR)/test-lorem-optimum-benchmark.el diff --git a/modules/lorem-optimum.el b/modules/lorem-optimum.el index 7b19125e..a6bec657 100644 --- a/modules/lorem-optimum.el +++ b/modules/lorem-optimum.el @@ -142,6 +142,8 @@ Uses O(n) algorithm by matching at position instead of creating substrings." (cj/markov-random-key chain))) (w1 (car state)) (w2 (cadr state)) + ;; tokens is built with `push' (prepend) and `nreverse'd at the end, + ;; so seed it reversed -- w2 then w1 -- to get w1 w2 ... after the flip. (tokens (list w2 w1))) (dotimes (_ (max 0 (- n 2))) (let ((next (cj/markov-next-word chain state))) |
