diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-11 23:52:49 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-11 23:52:49 -0500 |
| commit | b0ca38bc98f240e208edd08009856ab6de62c227 (patch) | |
| tree | 0412890e4480ade5e954104d428178bba3f4e64c /tests | |
| parent | b137223e76c75217b594bc5e46e7625b10e31b0f (diff) | |
| download | archsetup-b0ca38bc98f240e208edd08009856ab6de62c227.tar.gz archsetup-b0ca38bc98f240e208edd08009856ab6de62c227.zip | |
refactor(gallery): rename generated tokens.el to gallery-tokens.el
The generated file declares (provide 'gallery-tokens), but `require` resolves a feature by filename, so as tokens.el it could never load from a load-path. The name now matches the feature. gen_tokens.py, the renderer's load, and the README follow.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gallery-tokens/test_gen_tokens.py | 12 | ||||
| -rw-r--r-- | tests/gallery-widgets/test-gallery-widget.el | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/gallery-tokens/test_gen_tokens.py b/tests/gallery-tokens/test_gen_tokens.py index 414194e..b9fbb50 100644 --- a/tests/gallery-tokens/test_gen_tokens.py +++ b/tests/gallery-tokens/test_gen_tokens.py @@ -210,6 +210,16 @@ class RealTokensJson(unittest.TestCase): self.assertIn("pulse-rate", self.tokens["timing"]) +class DefaultElispFilename(unittest.TestCase): + """The default elisp target must be gallery-tokens.el so that the file's + (provide 'gallery-tokens) matches its name and `require` can resolve it + from a load-path. A tokens.el/gallery-tokens feature mismatch is a trap.""" + + def test_default_elisp_path_matches_provided_feature(self): + self.assertEqual( + os.path.basename(gt.DEFAULT_ELISP_NAME), "gallery-tokens.el") + + class MainIntegration(unittest.TestCase): """main() rewrites the html :root and writes the waybar + elisp files.""" @@ -218,7 +228,7 @@ class MainIntegration(unittest.TestCase): self.html = os.path.join(self.tmp, "gallery.html") self.tokens_path = os.path.join(self.tmp, "tokens.json") self.waybar = os.path.join(self.tmp, "tokens-waybar.css") - self.elisp = os.path.join(self.tmp, "tokens.el") + self.elisp = os.path.join(self.tmp, "gallery-tokens.el") with open(self.tokens_path, "w") as f: json.dump(FIXTURE, f) with open(self.html, "w") as f: diff --git a/tests/gallery-widgets/test-gallery-widget.el b/tests/gallery-widgets/test-gallery-widget.el index ec484bb..166cd59 100644 --- a/tests/gallery-widgets/test-gallery-widget.el +++ b/tests/gallery-widgets/test-gallery-widget.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; Tests for the svg.el proof-of-concept renderer in docs/prototypes/. -;; gallery-widget.el reads the generated tokens.el (same source of truth as +;; gallery-widget.el reads the generated gallery-tokens.el (same source of truth as ;; the web gallery and the waybar CSS) and renders gallery widgets as SVG. ;; These tests exercise the REAL module (loaded by path, not a copy): ;; token resolution, needle-angle math (normal/boundary/error), and the |
