diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-03 17:39:10 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-03 17:39:10 -0500 |
| commit | 0c085f2935418f365f6abd39ce008909dc13ed3c (patch) | |
| tree | 9c2126762fa5ef0bf62051da63f750cc2288d15c /tests/test-dev-fkeys--f6-test-runner-cmd-for.el | |
| parent | 1d9d252e8b9e1385337cd0af087a7007f8e62da8 (diff) | |
| download | dotemacs-0c085f2935418f365f6abd39ce008909dc13ed3c.tar.gz dotemacs-0c085f2935418f365f6abd39ce008909dc13ed3c.zip | |
fix(dev-fkeys): F6 elisp runner uses basename, not rel-path
I shipped Phase 2a with `cj/--f6-test-runner-cmd-for' building `make test-file FILE=<rel-path>' for elisp test files (e.g., FILE=tests/test-foo.el). The project Makefile prepends `tests/' to FILE itself, so the full invocation expands to `tests/tests/test-foo.el' and emacs reports "Cannot open load file". The bug surfaced on a live-test in step 7 of the Phase 2a smoke plan.
Fix: pass `(file-name-nondirectory rel-path)' so the Makefile gets just `test-foo.el' and re-prepends `tests/' itself.
Two unit tests in `test-dev-fkeys--f6-test-runner-cmd-for.el' had encoded the wrong expectation (the rel-path form). Two orchestrator tests in `test-dev-fkeys--f6-current-file-tests-impl.el' inherited the same wrong assertion via integration. Updated all four to assert the basename form.
Verified: full suite green, including the 4 updated tests. Live re-test on `tests/test-dev-fkeys--f6-language-detect.el' should now produce the working `make test-file FILE=test-dev-fkeys--f6-language-detect.el'.
Diffstat (limited to 'tests/test-dev-fkeys--f6-test-runner-cmd-for.el')
| -rw-r--r-- | tests/test-dev-fkeys--f6-test-runner-cmd-for.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test-dev-fkeys--f6-test-runner-cmd-for.el b/tests/test-dev-fkeys--f6-test-runner-cmd-for.el index d9f8f464..cb242889 100644 --- a/tests/test-dev-fkeys--f6-test-runner-cmd-for.el +++ b/tests/test-dev-fkeys--f6-test-runner-cmd-for.el @@ -24,11 +24,14 @@ ;;; Normal Cases — Elisp (ert-deftest test-dev-fkeys-f6-cmd-for-elisp-test-file () - "Normal: an elisp test file runs via `make test-file FILE=<path>'." + "Normal: an elisp test file runs via `make test-file FILE=<basename>'. +The project Makefile prepends `tests/' to whatever FILE you pass, so the +runner command must use just the basename (not the rel-path) to avoid +`tests/tests/...' double-prefix." (should (string= (cj/--f6-test-runner-cmd-for 'elisp t "tests/test-foo.el" "foo" "tests") - "make test-file FILE=tests/test-foo.el"))) + "make test-file FILE=test-foo.el"))) (ert-deftest test-dev-fkeys-f6-cmd-for-elisp-source-file () "Normal: an elisp source file runs via `make test-name TEST=^test-<stem>-'. @@ -78,11 +81,12 @@ test files." (ert-deftest test-dev-fkeys-f6-cmd-for-elisp-test-file-with-double-dash () "Boundary: a per-helper test file runs only that file, not the whole test-name prefix. `make test-file FILE=...' is precise; `test-name' -would over-match." +would over-match. Pass just the basename — the Makefile re-prepends +`tests/' itself." (should (string= (cj/--f6-test-runner-cmd-for 'elisp t "tests/test-foo--bar.el" "foo" "tests") - "make test-file FILE=tests/test-foo--bar.el"))) + "make test-file FILE=test-foo--bar.el"))) (ert-deftest test-dev-fkeys-f6-cmd-for-go-source-at-root () "Boundary: a Go source file at project root runs `go test ./'." |
